hoxy icon indicating copy to clipboard operation
hoxy copied to clipboard

No way to get the status message

Open bibhas2 opened this issue 8 years ago • 4 comments

I am using hoxy as a reverse proxy. I find no way to get the status message from the response. Example "INTERNAL SERVER ERROR".

HTTP/1.1 500 INTERNAL SERVER ERROR

bibhas2 avatar Mar 01 '16 13:03 bibhas2

You can get a status message using node's built in http.STATUS_CODES. https://nodejs.org/dist/latest-v4.x/docs/api/http.html#http_http_status_codes

greim avatar Mar 01 '16 17:03 greim

I need the exact status message returned by the server not some kind of translation of the status code to a text message. For example the following returns the message in all uppercase NOT FOUND.

http://httpbin.org/status/404

If that is not possible then I will do what you have suggested.

bibhas2 avatar Mar 01 '16 17:03 bibhas2

I'd like to reopen this. There is an upstream proxy that indicates some meaningful things by appending its name to the status message if it performs an action on the response.

ZzZombo avatar Apr 01 '17 11:04 ZzZombo

I'd accept a PR for this.

Relevant API: https://nodejs.org/api/http.html#http_message_statusmessage

greim avatar Apr 04 '17 04:04 greim