Comments (6)
I've read the mentioned RFC2616 paragraph.
Bug confirmed.
I'll review the code over the week and merge it on all Tufão branches (with changes if needed).
Thanks for the feedback.
from tufao.
Thanks. My patch is against an old version (1.0.2), doesn't come with a unit test and as indicated in the commit message with some open questions I couldn't answer myself. E.g. how strictly do you want to enforce this rule? Should ::write() just return false and these things.
I am looking forward for a proper fix.
from tufao.
My patch is against an old version (1.0.2)
For this feature/patch, ain't a problem.
doesn't come with a unit test and
HttpServerResponse
acts upon a QIODevice and unit tests could be done using QBuffer.
The tests cannot be done using headers, because the order is not guaranteed. Parsing the generated buffer if headers are present require a lot of implementation work. I'll leave this for later.
Having said that, I can implement the tests, but I'll first focus on the documentation changes.
as indicated in the commit message with some open questions I couldn't answer myself. E.g. how strictly do you want to enforce this rule? Should ::write() just return false and these things.
HTTP rules aren't very orthogonal and we end up with hacks like this.
The only path I see to fix this bug is breaking orthogonality also on Tufão and make the body aware of the response status code.
I don't want to enforce this rule to the user. Some behaviours of HTTP are unknown to Tufão and left to the user handle. For instance, RFC2616 document some HTTP verbs, but more were created by other protocols and Tufão doesn't know how to handle them, but it may be interesting for the user, then the task is left for the user to resolve.
I'm heading to a compromise now, but my schedule is less busy now and I'll be able to review and merge the patch when I came back.
Thanks for the responsive collaboration with the contribution.
from tufao.
Fixed.
@zecke, can you test the new version and confirm the fix? Then I'll release another stable version.
from tufao.
I didn't verify it with REST Sharp (my downstream was using REST Sharp) but using curl and looking at the output in wireshark the last thing in the response is the \r\n and Content-Length is 0.
from tufao.
using curl and looking at the output in wireshark the last thing in the response is the \r\n and Content-Length is 0.
The final "\r\n"
indicates the end of all headers and must be present.
Quoting section 4.4 of RFC 2616:
1.Any response message which "MUST NOT" include a message-body (such
as the 1xx, 204, and 304 responses and any response to a HEAD
request) is always terminated by the first empty line after the
header fields, regardless of the entity-header fields present in
the message.
So, a single "\r\n"
is expected. I'll create a tag and release the new version with the bugfix tomorrow.
from tufao.
Related Issues (20)
- Data is truncated when using WebSocket to transfer data over 128k HOT 2
- can't link apps in debug mode on VS HOT 6
- apps hang when linked to wrong library configuration on VS
- problem using HttpServerRequestRouter with Visual Studio HOT 2
- typo in httpserverrequestrouter.cpp
- Only the first cookie is considered HOT 1
- doc: ldconfig after install HOT 1
- Move news section from README.md to CHANGELOG.md
- Add some more shields from Shields.io
- SIGSEGV when using int HttpServerRequestRouter::map(std::initializer_list<Mapping> map) HOT 1
- Socket stops to accept connexion
- Loop parsing POST contains request with two "readyRead" HOT 5
- websocket transform large data data loss HOT 2
- Remove an unnecessary null pointer check HOT 1
- Create Conan package
- Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers. HOT 1
- server close connection after server response client HOT 2
- How to interact with HTML file
- incoming urls with # i.e http://localhost/#index.html HOT 4
- What is the maximum amount of data for a single transfer? HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tufao.