valyala / fasthttp

Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http
MIT License
21.66k stars 1.75k forks source link

conflict code #1590

Closed xj524598 closed 1 year ago

xj524598 commented 1 year ago

fasthttp version: 1.45.0

all is in picture

企业微信截图_ddc1b9f6-509a-4945-86ed-2fff34bd4b2c
erikdubbelboer commented 1 year ago

What this code does is it adds a Connection: close header to the request when the max connection duration has been reached. After the request has been send it removes this header again to keep the request object the same as how the user's code made it.

Keep in mind that the req.Write line is the one that actually writes the header.