Browse Source

webrtc: expose ice servers on OPTIONS CORS requests (#2479)

the link header was getting ignored by browser fetch as it was not exposed by Access-Control-Expose-Headers
pull/2482/head
Aakash Singh 2 years ago committed by GitHub
parent
commit
18733294c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      internal/core/webrtc_http_server.go

1
internal/core/webrtc_http_server.go

@ -227,6 +227,7 @@ func (s *webRTCHTTPServer) onRequest(ctx *gin.Context) { @@ -227,6 +227,7 @@ func (s *webRTCHTTPServer) onRequest(ctx *gin.Context) {
ctx.Writer.Header().Set("Access-Control-Allow-Methods", "OPTIONS, GET, POST, PATCH")
ctx.Writer.Header().Set("Access-Control-Allow-Headers", "Authorization, Content-Type, If-Match")
ctx.Writer.Header().Set("Access-Control-Expose-Headers", "Link")
ctx.Writer.Header()["Link"] = whip.LinkHeaderMarshal(servers)
ctx.Writer.WriteHeader(http.StatusNoContent)

Loading…
Cancel
Save