net: http: client: handle empty body for PUT/POST request response
In previous version of the HTTP API, commit 8ebaf29927
("net: http:
dont timeout on HTTP requests w/o body") fixed handling of HTTP
responses without body content.
For the new API, let's add a specific fix for when PUT/POST requests
are responded to with just the status code.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
This commit is contained in:
parent
a3a5c48d93
commit
a2dfaebafc
1 changed files with 7 additions and 0 deletions
|
@ -423,6 +423,13 @@ static int on_headers_complete(struct http_parser *parser)
|
|||
return 1;
|
||||
}
|
||||
|
||||
if ((ctx->http.req.method == HTTP_PUT ||
|
||||
ctx->http.req.method == HTTP_POST)
|
||||
&& ctx->http.rsp.content_length == 0) {
|
||||
NET_DBG("No body expected");
|
||||
return 1;
|
||||
}
|
||||
|
||||
NET_DBG("Headers complete");
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue