softwaremill / elasticmq

In-memory message queue with an Amazon SQS-compatible interface. Runs stand-alone or embedded.
https://softwaremill.com/open-source/
Apache License 2.0
2.56k stars 195 forks source link

400 status code for `\health` endpoint #1047

Closed igtsekov closed 2 months ago

igtsekov commented 2 months ago

Problem

I am testing the 1.6.8 version of elasticmq-native and I got this strange behaviour

$ curl -I http://localhost:9324/health
HTTP/1.1 400 Bad Request
Server: pekko-http/1.0.1
Date: Fri, 13 Sep 2024 14:35:27 GMT
Content-Type: text/xml; charset=UTF-8
Content-Length: 359

If I omit the -I flag I get OK

$ curl http://localhost:9324/health
OK%

Expected result

I expect to get status code 200 from the /health endpoint am I doing something wrong?

How to reproduce

I start the elasticmq in a docker container and curl the /health endpoint.

$ docker run -p 9324:9324 -p 9325:9325 softwaremill/elasticmq-native
igtsekov commented 2 months ago

My bad. I was unaware that -I send an HTTP HEAD request if I sent a GET request everything works as expected.

$ curl -I -X GET http://localhost:9324/health
HTTP/1.1 200 OK
Server: pekko-http/1.0.1
Date: Fri, 13 Sep 2024 14:41:27 GMT
Content-Type: text/plain; charset=UTF-8
Content-Length: 2

I am closing this.