Skip to content

Commit

Permalink
Avoid duplicating cors header. (#727)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonbloom authored Jan 17, 2025
1 parent 0232344 commit a4539f6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions runner/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ func (p *Proxy) injectLiveReload(resp *http.Response) (string, error) {
}

func (p *Proxy) proxyHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")

appURL := r.URL
appURL.Scheme = "http"
appURL.Host = fmt.Sprintf("localhost:%d", p.config.AppPort)
Expand Down Expand Up @@ -131,6 +129,7 @@ func (p *Proxy) proxyHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Add(k, v)
}
}
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Add("Via", viaHeaderValue)
w.WriteHeader(resp.StatusCode)

Expand Down

0 comments on commit a4539f6

Please sign in to comment.