Closed mholt closed 9 years ago
I'm totally ok with both of those. I'll have it ready soon.
Actually, methods, allowed_headers, and exposed_headers should probably stay. They are really just copied into response headers as-is, so the go code never needs to treat them as lists. They are just strings.
Ah, that makes sense. Sounds good to me. I'll clarify that in the docs.
origin in the config block actually accepts space or comma seperated, and as an inline-parameter it accepts commas. It can accept any or all of the above:
cors / foo.com,bar.com{
origin a.com b.com c.com,d.com
}
is technically valid.
Thanks for the changes!
I noticed while going through the docs for cors that allowedHeaders and exposedHeaders are comma-separated lists (and I think methods and origin might be, too). Caddyfile generally separates arguments using spaces, so instead of:
you would have:
Would this be a change you'd agree with making, for consistency?
Also, the camelCasing or whatever it's called of some of the keywords like
allowCredentials
is a little inconsistent; typically we stick with all lowercase words or, if necessary, separate the words with underscore:allow_credentials
. (proxy was the first to do this, I think - but it stuck) What would you think about either finding shorter names or switching to the underscore syntax?