convert query parameters to lowercase before reading them

This commit is contained in:
Hunter Kehoe 2023-03-06 19:16:18 -07:00
parent 477c9d3ed5
commit e3656d04dd
2 changed files with 18 additions and 1 deletions

View file

@ -309,6 +309,18 @@ func TestServer_PublishGETOnlyOneTopic(t *testing.T) {
require.Equal(t, 404, response.Code)
}
func TestServer_PublishCaseInsensitiveQueryParam(t *testing.T) {
s := newTestServer(t, newTestConfig(t))
response := request(t, s, "GET", "/mytopic/publish?MESSAGE=testing", "", nil)
require.Equal(t, "testing", toMessage(t, response.Body.String()).Message)
}
func TestServer_PublishInvalidQueryParam(t *testing.T) {
s := newTestServer(t, newTestConfig(t))
response := request(t, s, "GET", "/mytopic/publish?MESSAGE=testing&fakeParam=test", "", nil)
require.Equal(t, "testing", toMessage(t, response.Body.String()).Message)
}
func TestServer_PublishNoCache(t *testing.T) {
s := newTestServer(t, newTestConfig(t))