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

decompress_body: Do we want to recalculate content-length? #239

Closed
wojtekmach opened this issue Sep 3, 2023 · 4 comments
Closed

decompress_body: Do we want to recalculate content-length? #239

wojtekmach opened this issue Sep 3, 2023 · 4 comments

Comments

@wojtekmach
Copy link
Owner

Both fetch() and reqwest are dropping them: #190 (comment)

@wojtekmach wojtekmach changed the title decompress_body: Ensure we want to recalculate content-length decompress_body: Do we want to recalculate content-length? Sep 3, 2023
@wojtekmach
Copy link
Owner Author

Same for Go net/http:

package main

import (
  "fmt"
  "net/http"
)

func main() {
    resp, _ := http.Get("https://httpbin.org/gzip")
    fmt.Printf("resp.Uncompressed = %v\n", resp.Uncompressed)
    for name, values := range resp.Header {
        fmt.Printf("%v: %v\n", name, values)
    }
}
resp.Uncompressed = true
Date: [Sun, 03 Sep 2023 11:47:30 GMT]
Content-Type: [application/json]
Server: [gunicorn/19.9.0]
Access-Control-Allow-Origin: [*]
Access-Control-Allow-Credentials: [true]

@yordis
Copy link

yordis commented Sep 10, 2023

🤔 when would such value become valuable to recompute vs. letting upstream recompute it?

The only use cases I am thinking off is proxies-like use cases, but I am not sure if somebody should rely on the headers or be safe and check the body 🤷🏻

Any commitment to a particular behavior from your end thus far?

@wojtekmach
Copy link
Owner Author

Yeah exactly not sure we need to recompute it so I wouldn’t but ideally there is some prior art to go one way or the other.

@yordis
Copy link

yordis commented Sep 10, 2023

Would it be a good bet to follow fetch from the browser? I know it is silly, but the less computation the better.

While typing something came to my mind: how OTEL**** and telemetry would handle the situation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants