mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-24 20:11:56 -08:00
webrtc: fix propagating query parameters when appending slash to paths (#2771)
This commit is contained in:
parent
50e7b038c4
commit
4ccb245feb
1 changed files with 5 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue