-
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: add ErrSchemeMismatch #44855
Comments
This seems reasonable to me, especially given that this error is replacing a more-informative (to programs) Perhaps the error returned here should wrap the |
Three concrete possibilities that I can think of:
Option (2) requires the least change to the |
Can we wrap (2) in a function like |
I'm fine with (2). Or (1) if we name it, say, I wouldn't want to see a new function. That's too heavy in godoc for how fringe this is. |
Hi @bradfitz @rsc @empijei @neild any solution regarding this error message? @AkihiroSuda did you found the solution? Thank you |
Expose "http: server gave HTTP response to HTTPS client" error as ErrSchemeMismatch, so that it can be compared with errors.Is . Fixes golang#44855 Signed-off-by: Akihiro Suda <[email protected]>
Expose "http: server gave HTTP response to HTTPS client" error as ErrSchemeMismatch, so that it can be compared with errors.Is . Fixes golang#44855 Signed-off-by: Akihiro Suda <[email protected]>
PR: #50939 ( |
Change https://golang.org/cl/382117 mentions this issue: |
This is a proposed API change, so adding to the proposal process. Specific proposal: Add |
This proposal has been added to the active column of the proposals project |
Sounds like everyone is in favor of this. Have all concerns been addressed? |
I don't see any remaining concern |
Based on the discussion above, this proposal seems like a likely accept. |
No change in consensus, so accepted. 🎉 |
Expose "http: server gave HTTP response to HTTPS client" error as ErrSchemeMismatch, so that it can be compared with errors.Is . Fixes golang#44855 Signed-off-by: Akihiro Suda <[email protected]>
Change https://go.dev/cl/496795 mentions this issue: |
For #44855 Change-Id: I517394b227ea948ed3e1f9ffdaab2bb2676863c8 Reviewed-on: https://go-review.googlesource.com/c/go/+/496795 TryBot-Bypass: Dmitri Shuralyov <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]>
ref: golang/go#44855 Signed-off-by: Yadong Ding <[email protected]>
ref: golang/go#44855 Signed-off-by: Yadong Ding <[email protected]>
ref: golang/go#44855 Signed-off-by: Yadong Ding <[email protected]>
ref: golang/go#44855 Signed-off-by: Yadong Ding <[email protected]>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What did you expect to see?
I'd like to see the
http: server gave HTTP response to HTTPS client
error in thenet/http
package to be exposed as a constant that can be compared witherrors.Is
go/src/net/http/client.go
Line 262 in f21be2f
Context
I'm working on a clone of Docker called nerdctl (contaiNERD ctl).
I want to compare
http: server gave HTTP response to HTTPS client
witherrors.Is
, for ease of reimplementingdockerd --insecure-registries
, which attempts HTTPS first and then falls back to HTTP.What did you see instead?
The
http: server gave HTTP response to HTTPS client
error is not exposed.The text was updated successfully, but these errors were encountered: