diff options
| author | James Mills <prologic@shortcircuit.net.au> | 2020-03-25 07:36:23 +1000 |
|---|---|---|
| committer | James Mills <prologic@shortcircuit.net.au> | 2020-03-25 07:36:23 +1000 |
| commit | 3d0b3044ec5a41949185f2622e33726ada29ee0b (patch) | |
| tree | 2014fd10821c1148f149f0d13e0f1c0f0e855513 | |
| parent | b6f36d2738fa9b929a58b5c750e64afe351965ec (diff) | |
Add OPTIONS to / and /upload endpoints
| -rw-r--r-- | app/app.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -76,8 +76,8 @@ func NewApp(cfg *Config) (*App, error) { // Setup Router r := mux.NewRouter().StrictSlash(true) - r.HandleFunc("/", a.indexHandler).Methods("GET") - r.HandleFunc("/upload", a.uploadHandler).Methods("GET", "POST") + r.HandleFunc("/", a.indexHandler).Methods("GET", "OPTIONS") + r.HandleFunc("/upload", a.uploadHandler).Methods("GET", "OPTIONS", "POST") r.HandleFunc("/v/{id}.mp4", a.videoHandler).Methods("GET") r.HandleFunc("/v/{prefix}/{id}.mp4", a.videoHandler).Methods("GET") r.HandleFunc("/t/{id}", a.thumbHandler).Methods("GET") @@ -93,7 +93,7 @@ func NewApp(cfg *Config) (*App, error) { r.PathPrefix("/static/").Handler(fsHandler).Methods("GET") cors := handlers.CORS( - handlers.AllowedHeaders([]string{"Content-Type"}), + handlers.AllowedHeaders([]string{"content-type"}), handlers.AllowedOrigins([]string{"*"}), handlers.AllowCredentials(), ) |
