reverse proxy: validate versions in http transport#7112
Conversation
|
Validation should probably happen in Validate, not provision. But also should happen in Caddyfile unmarshaling (earlier than both). |
mholt
left a comment
There was a problem hiding this comment.
Thanks Weidi!
I somehow totally missed that.
I guess the incongruency with "h2c" is a bit annoying, since HTTP/2 over Cleartext is called "h2c" but all the others are just straight version numbers, not "h" whatever.
Thank you again for this patch :)
|
|
||
| var ( | ||
| allowedVersions = []string{"1.1", "2", "h2c", "3"} | ||
| allowedVersionsString = strings.Join(allowedVersions, ", ") |
There was a problem hiding this comment.
Nit: This could just be inlined below with the error message, since it won't be happening THAT often, in fact quite rarely; but, I'm okay with it either way. So you don't have to change it.
You know I thought about this too before I saw your comment (which was just now, for some reason) -- and I agree... it would make sense. Although -- and I haven't checked yet -- but if there are places where we are manually calling (In hindsight, I think separating Provision/Validate in the v2 design was not especially helpful like I thought it would be.) |
Fix 7111