Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to serve static files as response to POST #203

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yura-pakhuchiy
Copy link

Sometimes it is useful to serve static answers to POST requests. However ecstatic rejects all requests except GET or HEAD. This small patch fixes it.

Sometimes it is useful to serve static answers to POST requests. However ecstatic rejects all requests except GET or HEAD. This small patch fixes it.
@jfhbrook
Copy link
Owner

I, uh, why would you want this? POSTs should do something. At the least, this behavior seems technically incorrect.

@yura-pakhuchiy
Copy link
Author

yura-pakhuchiy commented Oct 22, 2017

To test application which uses HTTP API. I can create directory which contains replies to requests and point application to it. Without this patch I can test only GET requests, however POST request are very common as well.

While I agree that requests that can change something should use POST, there is no requirement for every POST request to change something. Consider POST request with wrong access token, server should just ignore it.

BTW, PHP web server (php -S) supports both GET and POST for serving files. However I think it is bit overkill to install PHP just to use php -S, that is why I want similar functionality in node based project.

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.

None yet

2 participants