Skip to content

Add support for requesting raw response body#37

Merged
mendhak merged 6 commits intomendhak:masterfrom
natexcvi:master
May 24, 2022
Merged

Add support for requesting raw response body#37
mendhak merged 6 commits intomendhak:masterfrom
natexcvi:master

Conversation

@natexcvi
Copy link
Contributor

If the request query string contains flag raw_response=true, the server will return the request body as the response body as is, without wrapping it in the meta-object containing other request info.

@mendhak
Copy link
Owner

mendhak commented May 21, 2022

Hey thanks for this. I did a test and I think I understand what this is doing - just sending the body back. In that case the parameter name should be more like, response_body_only=true, since that describes what it's doing a bit better.

Also question, what's the purpose of the Buffer.send(), couldn't it just be a res.send(req.body)?

@natexcvi
Copy link
Contributor Author

Changed the query param name to response_body_only. Using Buffer was indeed redundant so I removed it.

@mendhak mendhak merged commit 4d56a92 into mendhak:master May 24, 2022
@mendhak
Copy link
Owner

mendhak commented May 24, 2022

OK thanks for that, tag :24 is now on Docker Hub.

https://hub.docker.com/r/mendhak/http-https-echo/tags?page=1&ordering=last_updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants