-
Notifications
You must be signed in to change notification settings - Fork 634
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
HTTP POST query string duplication when keep alive is true #1043
Comments
I forgot to mention that debugging information will be written to the command prompt (or terminal). Once you open the html file with your browser, post a few times and you will see the bad output that is written when keep alive is set to true. |
Thanks for the detailed report. I was able to build and run the program with no trouble, and I used the HTML form you provided to send a POST to the server. I can reproduce the defect. Well, this is a little embarassing, seems I didn't follow my own documentation. HTTP read operations which accept messages as parameters require a newly constructed message. This is easily accomplished by putting the request in an "This object should not have previous contents, otherwise the behavior is undefined. " I'll make sure this gets fixed for Boost 1.67, which is coming out in several weeks. Note that the problem is not directly cause by |
Please try the v160 branch here: Reapply your changes, and let me know that it is fixed. I tried it and it worked. This will go into Boost 1.67.0. |
Instead of
|
Hi Vinnie, your empty request fix resolved the problem! Thank you! |
Version of Beast
BOOST_BEAST_VERSION 144
Steps necessary to reproduce the problem
Simply post an HTML form to a Beast Server configured with 'response.keep_alive(true)'.
All relevant compiler information
VC++ 2017 and GCC version 6.3.0
Simple modification to http_server_async.cpp to handle HTTP POST. Unfortunately, setting keep_alive causes your query strings to be concatenated after the last query string. For example:
MY SIMPLE HTML FORM GETTING STRIPPED OUT, SO I REMOVED THE FIRST 'LESS THAN SIGN' FOR EACH HTML TAG. Simply (add the missing less than tags) then save to html file on your desktop and open with your web browser:
Here is the full source code (VC++/GCC) that demonstrates the problem. I marked my addition with 'begin post handler' and 'end post handler'. Other than that, there are no other changes to the Beast demo.
The text was updated successfully, but these errors were encountered: