-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
net/http: set Content-Length:0 for empty PATCH requests as with POST, PATCH #40991
Conversation
This PR (HEAD: 12a3903) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/250039 to see it. Tip: You can toggle comments from me using the |
Message from Emmanuel Odeke: Patch Set 2: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/250039. |
Message from Meher Assel: Patch Set 4: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/250039. |
Message from Emmanuel Odeke: Patch Set 4: Run-TryBot+1 Code-Review+2 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/250039. |
Message from Gobot Gobot: Patch Set 4: TryBots beginning. Status page: https://farmer.golang.org/try?commit=4be3b4b0 Please don’t reply on this GitHub thread. Visit golang.org/cl/250039. |
Message from Gobot Gobot: Patch Set 4: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/250039. |
Message from Emmanuel Odeke: Patch Set 5: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/250039. |
Message from Gobot Gobot: Patch Set 5: TryBots beginning. Status page: https://farmer.golang.org/try?commit=e0ec8f6d Please don’t reply on this GitHub thread. Visit golang.org/cl/250039. |
Message from Gobot Gobot: Patch Set 5: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/250039. |
… PATCH Sets Content-Length:0 for nil bodies in PATCH requests, as we already do for POST and PUT requests. RFC 2616 mentions that unless a method’s Content-Length is forbidden it can send one. In the wild, we’ve found that Microsoft Azure’s DataLake Gen2 storage API https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update deliberately rejects PATCH requests without a Content-Length, yet there is no workaround for setting that header when trying to flush the content of a file which was uploaded in a previous request. Fixes #40978 Change-Id: Ib0a623b907d827a1c5ee431dca3c41024fa291c5 GitHub-Last-Rev: 12a3903 GitHub-Pull-Request: #40991 Reviewed-on: https://go-review.googlesource.com/c/go/+/250039 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
This PR is being closed because golang.org/cl/250039 has been merged. |
Sets Content-Length:0 for nil bodies in PATCH requests, as we already do for POST and PUT requests.
RFC 2616 mentions that unless a method’s Content-Length is forbidden it can send one.
In the wild, we’ve found that Microsoft Azure’s DataLake Gen2 storage API https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update deliberately rejects PATCH requests without a Content-Length, yet there is no workaround for setting that header when trying to flush the content of a file which was uploaded in a previous request.
Fixes #40978