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

net/http: support status code 102 (Processing) in ResponseWriter #36734

Open
majewsky opened this issue Jan 24, 2020 · 2 comments
Open

net/http: support status code 102 (Processing) in ResponseWriter #36734

majewsky opened this issue Jan 24, 2020 · 2 comments
Milestone

Comments

@majewsky
Copy link

@majewsky majewsky commented Jan 24, 2020

HTTP status code 102 (Processing) is defined by RFC 2518, section 10.1:

This status code SHOULD only be sent when the server has a reasonable expectation that the request will take significant time to complete. [...] The server MUST send a final response after the request has been completed.

As of now (Go 1.13.6), there is no way to actually send a 102 response because ResponseWriter.WriteHeader() can only be called once. Any successive calls are rejected (here).

Since the ResponseWriter interface cannot be extended without breaking backwards compatibility, a new interface should be added (and implemented by the existing ResponseWriter implementations) that exposes a function for sending an interim response with status 102.

@toothrot toothrot added this to the Backlog milestone Jan 24, 2020
@toothrot

This comment has been minimized.

Copy link
Contributor

@toothrot toothrot commented Jan 24, 2020

WebDAV specific features might be better suited for x/net/webdav. I'm not positive we could make this change in net/http while maintaining API compatibility.

/cc @bradfitz @nigeltao

@bradfitz

This comment has been minimized.

Copy link
Contributor

@bradfitz bradfitz commented Jan 24, 2020

I don't think we'd need API changes. We could just permit WriteHeader(102) followed by a non-1xx status later

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.