-
Notifications
You must be signed in to change notification settings - Fork 425
Introduced new chunked transfer encoding parser to remove chunk markers #720
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
Changes from all commits
673b853
c4d758a
e9bf5f7
9586a81
c70f774
ff5c7c8
192d520
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,9 +15,12 @@ namespace http = boost::network::http; | |
TYPED_TEST_CASE(HTTPClientTest, ClientTypes); | ||
|
||
TYPED_TEST(HTTPClientTest, GetDifferentPort) { | ||
TypeParam client; | ||
typename TypeParam::request r("http://www.boost.org:80/"); | ||
auto response_ = client.get(r); | ||
using client = TypeParam; | ||
typename client::options options; | ||
options.remove_chunk_markers(true); | ||
client client_; | ||
typename TypeParam::request request("http://www.boost.org:80/"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know this might be out-of-scope, but could you make this point to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately cpp-netlib.org does not yield chunk encoded content. It does not matter much for this particular test, but for the streaming test we'd have all scenarios covered with www.boost.org: it yields chunk encoded content for http/1.1 clients and non encoded content for http/1.0 clients. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, good point, thanks. |
||
auto response_ = client_.get(request); | ||
auto range = headers(response_)["Content-Type"]; | ||
EXPECT_TRUE(std::begin(range) != std::end(range)); | ||
EXPECT_NE(0, body(response_).size()); | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@umennel Careful -- this actually breaks previous behavior. Now, unless you set
remove_chunk_markers
totrue
, the following code will produce a chunked-encoded string:@deanberris Is this what we want?
To put it another way, can you think of a case where we wouldn't want
remove_chunk_markers
to default totrue
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@igorpeshansky, indeed, the default should be true. Otherwise it is hard to keep the behavior consistent. We should decide on this before merging into 0.13.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, I'll send a PR shortly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sent #830.