Skip to content

Commit b29d2f6

Browse files
committed
fix REPORT method in client side streaming requests
1 parent 02e6563 commit b29d2f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libs/server-sent-events/src/client.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,6 @@ std::shared_ptr<Client> Builder::build() {
623623
}
624624

625625
auto request = request_;
626-
request.body() = "";
627626

628627
if (request.method() == http::verb::post ||
629628
request.method() == http::verb::report) {
@@ -633,6 +632,9 @@ std::shared_ptr<Client> Builder::build() {
633632
content_header == request.end()) {
634633
request.set(http::field::content_type, "text/plain");
635634
}
635+
} else {
636+
// If this is *not* a post or report, then make sure no body is sent.
637+
request.body() = "";
636638
}
637639

638640
request.prepare_payload();

0 commit comments

Comments
 (0)