mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-05-23 15:27:38 +02:00
Do not allow comma in topic name in publish via GET endpoint (no ticket)
This commit is contained in:
parent
806893962c
commit
b409c89d3b
3 changed files with 26 additions and 12 deletions
server
|
@ -203,6 +203,14 @@ func TestServer_PublishPriority(t *testing.T) {
|
|||
require.Equal(t, 40007, toHTTPError(t, response.Body.String()).Code)
|
||||
}
|
||||
|
||||
func TestServer_PublishGETOnlyOneTopic(t *testing.T) {
|
||||
// This tests a bug that allowed publishing topics with a comma in the name (no ticket)
|
||||
|
||||
s := newTestServer(t, newTestConfig(t))
|
||||
response := request(t, s, "GET", "/mytopic,mytopic2/publish?m=hi", "", nil)
|
||||
require.Equal(t, 404, response.Code)
|
||||
}
|
||||
|
||||
func TestServer_PublishNoCache(t *testing.T) {
|
||||
s := newTestServer(t, newTestConfig(t))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue