We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
the following code is borrowed from this example..
I made a few minor changes, but I'm not familiar with the Go language.. so the syntax may be need some correction.
it could be applied to devd.go..
type HTTPHeaderValue http.Header func (h HTTPHeaderValue) Set(value string) error { parts := strings.SplitN(value, ":", 2) if len(parts) != 2 { return fmt.Errorf("expected 'HEADER:VALUE' got '%s'", value) } (http.Header)(h).Add(parts[0], parts[1]) return nil } func (h HTTPHeaderValue) String() string { return "" } func (h HTTPHeaderValue) IsCumulative() bool { return true } func HTTPHeader(s kingpin.Settings) (target *http.Header) { target = &http.Header{} s.SetValue((*HTTPHeaderValue)(target)) return } hdrs := HTTPHeader(kingpin.Flag("header", "Add HTTP response header").Short('H').PlaceHolder("HEADER:VALUE")) if *cors { hdrs.Set("Access-Control-Allow-Origin", "*") }
the intention is to accept multiple CLI --header="name:value" options
--header="name:value"
ex:
devd --header="Strict-Transport-Security:max-age=0" --header="Cache-Control:max-age=0" --port=443 --all --tls .
The text was updated successfully, but these errors were encountered:
after-thought:
-H
Sorry, something went wrong.
No branches or pull requests
the following code is borrowed from this example..
I made a few minor changes, but I'm not familiar with the Go language.. so the syntax may be need some correction.
it could be applied to devd.go..
the intention is to accept multiple CLI
--header="name:value"
optionsex:
The text was updated successfully, but these errors were encountered: