mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-20 09:00:13 +01:00
Make api URL dynamic in web app
This commit is contained in:
parent
ad12b483ff
commit
57b4862a5b
4 changed files with 76 additions and 26 deletions
|
|
@ -25,8 +25,7 @@ func New(token string) *API {
|
|||
|
||||
func (api *API) EnableCors(fn http.HandlerFunc) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Add("Access-Control-Allow-Origin", "http://localhost:8001") // todo: configurable port
|
||||
w.Header().Add("Access-Control-Allow-Credentials", "true")
|
||||
w.Header().Add("Access-Control-Allow-Origin", "*")
|
||||
w.Header().Add("Access-Control-Allow-Headers", "Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization, accept, origin, Cache-Control, X-Requested-With")
|
||||
w.Header().Add("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue