Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5c5dd1c

Browse filesBrowse files
committed
Ensure Access-Control-Allow-Origin header is not overridden
1 parent 7ccbb9b commit 5c5dd1c
Copy full SHA for 5c5dd1c

File tree

1 file changed

+3
-1
lines changed
Filter options

1 file changed

+3
-1
lines changed

‎local/http/http.go

Copy file name to clipboardExpand all lines: local/http/http.go
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ func (s *Server) ProxyHandler(w http.ResponseWriter, r *http.Request) {
214214
// Handler handles HTTP requests
215215
func (s *Server) Handler(w http.ResponseWriter, r *http.Request) {
216216
if s.AllowCORS {
217-
w.Header().Add("Access-Control-Allow-Origin", "*")
217+
if w.Header().Get("Access-Control-Allow-Origin") != "" {
218+
w.Header().Add("Access-Control-Allow-Origin", "*")
219+
}
218220
}
219221

220222
// static file?

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.