Skip to content
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

Proxy: Missing content-length on get query with body and transfer-encoding chunked #3310

Closed
cdemonchy opened this issue Aug 22, 2019 · 1 comment · Fixed by linkerd/linkerd2-proxy#340
Assignees
Labels
priority/P0 Release Blocker

Comments

@cdemonchy
Copy link

Bug Report

What is the issue?

When a client send a get query with a body using chunked transfer encoding, linkerd-proxy forward the query without using chunk and without content-length header.

The backend server wants a body but does not see it as there is no content-length header.

How can it be reproduced?

We can forge query with curl :

# curl -H'Conten0/_mget  -d '{"docs": [{"_id": "foo", "_index": "bar"]}' -vGET http://10.3.56.59:9200
*   Trying 10.3.56.59...
* TCP_NODELAY set
* Connected to 10.3.56.59 (10.3.56.59) port 9200 (#0)
> GET /_mget HTTP/1.1
> Host: 10.3.56.59:9200
> User-Agent: curl/7.52.1
> Accept: */*
> Content-Type: application/json
> Transfer-Encoding: chunked
> 
> 2a
* upload completely sent off: 49 out of 42 bytes
< HTTP/1.1 400 Bad Request
< content-type: application/json; charset=UTF-8
< content-length: 203
< date: Thu, 22 Aug 2019 08:04:36 GMT
< 
* Curl_http_done: called premature == 0
* Connection #0 to host 10.3.56.59 left intact
{"error":{"root_cause":[{"type":"parse_exception","reason":"request body or source parameter is required"}],"type":"parse_exception","reason":"request body or source parameter is required"},"status":400}

Logs, error output, etc

A capture using linkerd-debug container

Before the proxy :

GET /_mget HTTP/1.1
Host: 10.3.56.59:9200
User-Agent: curl/7.52.1
Accept: */*
Content-Type: application/json
Transfer-Encoding: chunked

2a
{"docs": [{"_id": "foo", "_index": "bar"]}
0

After the proxy :

GET /_mget HTTP/1.1
host: 10.3.56.59:9200
user-agent: curl/7.52.1
accept: */*
content-type: application/json
l5d-dst-canonical: 10.3.56.59:9200

{"docs": [{"_id": "foo", "_index": "bar"]}

Environment

  • Kubernetes Version: 1.14.1
  • Cluster Environment: On premise deployed with kubespray
  • Host OS: CoreOS
  • Linkerd version: 2.4.0
@olix0r olix0r added priority/P1 Planned for Release priority/P0 Release Blocker and removed priority/P1 Planned for Release labels Sep 3, 2019
@seanmonstar seanmonstar self-assigned this Sep 4, 2019
@seanmonstar
Copy link
Contributor

Bug filed in the HTTP library repo: hyperium/hyper#1925

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority/P0 Release Blocker
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants