-
Notifications
You must be signed in to change notification settings - Fork 557
POST will hang at execute #83
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
Comments
Hello, Same here. Have no idea what's wrong. It's a shame since it is the only HTTP reverse proxy servlet I could find. |
Please debug it. Perhaps an older version of this proxy didn't have this problem? Maybe it's sensitive to which HttpClient is used? |
Seems like the way it handle POST is broken. Had to change it to handle multipart and standard POST. |
Sorry for the delayed response. @kensee, if I understood you correctly, it seems that you have already done all the debugging. If so, could you share the solution? |
@dsmiley, so I did some debugging and in my case it is dup of #54. OrderedHiddenHttpMethodFilter of Spring Boot is calling getParameter and body of the request gets consumed. So when proxy calls getInputStream, it gets blank input. InputStreamEntity is created with explicitly specified content length, which is non-zero, so InputStreamEntity tries to read specified byte count indefinitely thus creating the hang effect. |
Aaaah; yes. This is not a bug but a.... "gotcha", if you will, with knowing how not to use this servlet. If you can suggest a work-around for Spring Boot in particular, or can surmise how the proxy itself might better handle this, I welcome your input. |
Well, in my case, disabling WebMvcAutoConfiguration was acceptable solution: About handling this situation better in proxy side, I have no ideas that I like. |
The proxy can't handle 100 continue, if the post contains header 'Expect: 100 continue', it can't forward request body to server. |
@kuun do you believe your comment applies to the O.P.'s issue? If you're not sure then please file a new issue. I ought to close this one, I think. |
My solution to the Spring Boot problem was to refactor the proxy code so it could be called from a filter. You also need to make sure the filter executes before Spring's ones: use a FilterRegistrationBean and set order = Integer.MIN_VALUE. |
@Seldomseenkid Although I want the core servlet to be stand-alone (one source file), I'm open to the idea of adding a separate |
I was able to resolve this issue in my project by disabling HiddenHttpMethodFilter, as follows: @Bean
public FilterRegistrationBean registration(HiddenHttpMethodFilter filter) {
FilterRegistrationBean registration = new FilterRegistrationBean(filter);
registration.setEnabled(false);
return registration;
} That particular solution was found here: https://stackoverflow.com/questions/8522568/why-is-httpservletrequest-inputstream-empty Spring Boot version: 1.4.1.RELEASE |
Yes! Disabling HiddenHttpMethodFilter worked for me too. |
I looked
|
It calls |
Hi,
I created a simple form to do a POST and it hang at proxyResponse = proxyClient.execute. GET is working fine.
Anyone having the same issue? or am I missing something.
The text was updated successfully, but these errors were encountered: