mirror of
https://github.com/openfaas/faas.git
synced 2025-06-18 12:06:37 +00:00
Allow CORS to GitHub raw
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
@ -143,7 +143,12 @@ func main() {
|
||||
}
|
||||
|
||||
fs := http.FileServer(http.Dir("./assets/"))
|
||||
r.PathPrefix("/ui/").Handler(http.StripPrefix("/ui", fs)).Methods("GET")
|
||||
|
||||
// This URL allows access from the UI to the OpenFaaS store
|
||||
allowedCORSHost := "raw.githubusercontent.com"
|
||||
fsCORS := internalHandlers.DecorateWithCORS(fs, allowedCORSHost)
|
||||
|
||||
r.PathPrefix("/ui/").Handler(http.StripPrefix("/ui", fsCORS)).Methods("GET")
|
||||
|
||||
r.HandleFunc("/", faasHandlers.RoutelessProxy).Methods("POST")
|
||||
|
||||
|
Reference in New Issue
Block a user