facebook / facebook/proxygen

HEAD request and Content-Lenght

Open
#556 2 comments 1 reaction 1 assignee Claimed by @hanidamlaj View on GitHub
Dominant language
C++
Stars
8.4k
Forks
1.5k
Avg merge
10m
Merged PRs (30d)
2

Description

Hi, I encountered this funny issue while using proxygen as server.
On HEAD request I'm suppose to set Content-Lenght to value it would be and send no body.
So I do,
...
builder->header(proxygen::HTTP_HEADER_CONTENT_LENGTH, std::to_string(len));
builder->sendWithEOM();
however the latter sendWithEOM() (calls send()) resets the Content-Lenght back to zero.
I workarounded that by sending empty chunk first before sendWithEOM().

But I wonder if this is proxygen ResponseBuilder issue or I'm doing it wrong?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.