mirror of
https://github.com/Luzifer/ots.git
synced 2025-04-19 06:55:51 -04:00
Merge 1e3d10c1aea807314dbc09e9b24c14f15ceda38c into 45184a496e33a21c2745c5e0431a47503afd9891
This commit is contained in:
commit
4b7adb5fad
10
api.go
10
api.go
@ -56,6 +56,16 @@ func (a apiServer) Register(r *mux.Router) {
|
||||
}
|
||||
|
||||
func (a apiServer) handleCreate(res http.ResponseWriter, r *http.Request) {
|
||||
if cust.AddCORSHeaders {
|
||||
res.Header().Set("Access-Control-Allow-Origin", "*")
|
||||
res.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS")
|
||||
if r.Method == http.MethodOptions {
|
||||
res.WriteHeader(http.StatusNoContent)
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if cust.MaxSecretSize > 0 {
|
||||
// As a safeguard against HUGE payloads behind a misconfigured
|
||||
// proxy we take double the maximum secret size after which we
|
||||
|
@ -41,6 +41,7 @@ type (
|
||||
MetricsAllowedSubnets []string `json:"-" yaml:"metricsAllowedSubnets"`
|
||||
OverlayFSPath string `json:"-" yaml:"overlayFSPath"`
|
||||
UseFormalLanguage bool `json:"-" yaml:"useFormalLanguage"`
|
||||
AddCORSHeaders bool `json:"-" yaml:"addCORSHeaders"`
|
||||
|
||||
FooterLinks []FooterLink `json:"footerLinks,omitempty" yaml:"footerLinks"`
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user