greim / hoxy

Web-hacking proxy API for node
http://greim.github.io/hoxy/
MIT License
597 stars 97 forks source link

No way to get the status message #77

Open bibhas2 opened 8 years ago

bibhas2 commented 8 years ago

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
greim commented 8 years ago

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

bibhas2 commented 8 years ago

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.

ZzZombo commented 7 years ago

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.

greim commented 7 years ago

I'd accept a PR for this.

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