-
Notifications
You must be signed in to change notification settings - Fork 11
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 for custom management of "Invalid request URI" #118
Comments
Are you receiving valid requests with invalid URIs? I understand the sentiment of wanting to receive all requests, however there are many cases where invalid requests are dropped since there is no way to make sense of them. Previously mummy did not decode the URI before doing routing, which would break for things that included spaces in routes for example, eg "/my path/" would not match "my%20path". In this case, an invalid URI cannot be properly routed. Calling the errorHandler is reasonable, but I am missing some understanding of a real concrete scenario to base this around. It could appear to be a bunch of plumbing and statefulness for a request that no client ever sees? For example, a request with an invalid chunked encoding is dropped. There is no way to make sense of the body. Passing that invalid encoded body to a handler and expecting it to figure it out seems very unexpected. Each handler would need some sort of "is the body actually valid" check? Is the invalid body stored somewhere other than the valid body? Where is the valid-ness made available? etc. Same goes for Having a good solid real-world situation will I think clarify what is best to do here -- eg is errorHandler actually good or is maybe |
Relevant: golang/go#21548 |
Thanks for the feedback and the Go-link, Ryan! Maybe it's just a me-use-case :) ? I've been accustomed to receiving the requests and managing them all, so suddenly not having that possibility was the origin of the issue. I don't have a use case for using the 1) Log management and incident tracking: 2) Identifying bad inputs: And I think you're right, the |
Case
With Mummy 0.4.x, the commit below implements a connection drop on an invalid request URI due to the new parsing of URI elements.
Problem
Running Mummy behind nginx and making a GET request for
localhost:8080/badparam?test=%
will drop the connection within Mummy with the log-message "Dropped connection, invalid request URI," causing nginx to send a 502 result. In Mummy versions prior to 0.4.x, this type of error was ignored, and the route was served, allowing for a custom-formatted page and logging the bad URI in the backend.I want control over my webserver and incoming requests. I like that Mummy parses the parameters for me, but I don't want it to automatically decide whether to drop the connection without giving me the option to provide custom management.
Question
Can we make Mummy less restrictive in this approach? Either by passing the data to the route without the parameters or, at least, using the
errorHandler
in some way?Blame
b056572#diff-1e13710d6692a0c54d414e3ba123be6e4b788ce3d95abc4f9d4c9db4cec43c94R823-R829
The text was updated successfully, but these errors were encountered: