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

Add support for possible outputs from #114

Merged
merged 1 commit into from
Aug 1, 2013

Conversation

omarkj
Copy link
Contributor

@omarkj omarkj commented Jul 11, 2013

I was having problems with mochiweb when a client issues an HTTP command like this:

CONNECT host:port HTTP/1.1

This will be decoded using erlang:decode_package/3 and will cause an error in the file mochiweb.erl causing that acceptor to crash with a function clause error. This is happening because the output of decode_packge/3 is {scheme, HttpString, HttpString} which is not handled in the function mochiweb:new_request/1.

I patched that file to support all possible outputs from decode_package/3 so I'm able to return an error message to the clients. Both NGINX and Apache return 400 by default.

I'm not sure requests like this should be forwared to the user of the mochiweb server or just be unsupported. If they are supposed to be unsupported an error (400?) should probably be returned instead.

`erlang:decode_package/3` so they can be handled
gracefully.
etrepum added a commit that referenced this pull request Aug 1, 2013
Add support for all possible outputs of erlang:decode_packet/3
@etrepum etrepum merged commit 0f639f6 into mochi:master Aug 1, 2013
etrepum added a commit that referenced this pull request Aug 1, 2013
etrepum added a commit that referenced this pull request Aug 1, 2013
tsloughter pushed a commit to heroku/mochiweb that referenced this pull request Sep 18, 2013
tsloughter pushed a commit to heroku/mochiweb that referenced this pull request Sep 18, 2013
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