Browse Source

webrtc: fix propagating query parameters when appending slash to paths (#2771)

pull/2772/head
Alessandro Ros 1 year ago committed by GitHub
parent
commit
4ccb245feb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      internal/core/webrtc_http_server.go

6
internal/core/webrtc_http_server.go

@ -352,7 +352,11 @@ func (s *webRTCHTTPServer) onRequest(ctx *gin.Context) { @@ -352,7 +352,11 @@ func (s *webRTCHTTPServer) onRequest(ctx *gin.Context) {
s.onPage(ctx, ctx.Request.URL.Path[1:len(ctx.Request.URL.Path)-len("/publish")], true)
case ctx.Request.URL.Path[len(ctx.Request.URL.Path)-1] != '/':
ctx.Writer.Header().Set("Location", ctx.Request.URL.Path[1:]+"/")
l := ctx.Request.URL.Path[1:] + "/"
if ctx.Request.URL.RawQuery != "" {
l += "?" + ctx.Request.URL.RawQuery
}
ctx.Writer.Header().Set("Location", l)
ctx.Writer.WriteHeader(http.StatusMovedPermanently)
default:

Loading…
Cancel
Save