Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DELETE URL problem #3195

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions internal/servers/webrtc/http_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
})
}

func sessionLocation(publish bool, secret uuid.UUID) string {

Check failure on line 43 in internal/servers/webrtc/http_server.go

View workflow job for this annotation

GitHub Actions / golangci_lint

func `sessionLocation` is unused (unused)
ret := ""
if publish {
ret += "whip"
Expand Down Expand Up @@ -158,8 +158,8 @@
}

ctx.Writer.Header().Set("Access-Control-Allow-Methods", "OPTIONS, GET, POST, PATCH, DELETE")
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().Set("Access-Control-Allow-Headers", "Authorization, Content-Type, If-Match, Access-Control-Allow-Methods, ETag")

Check failure on line 161 in internal/servers/webrtc/http_server.go

View workflow job for this annotation

GitHub Actions / golangci_lint

line is 133 characters (lll)
ctx.Writer.Header().Set("Access-Control-Expose-Headers", "Link, Access-Control-Allow-Methods, ETag")
ctx.Writer.Header()["Link"] = webrtc.LinkHeaderMarshal(servers)
ctx.Writer.WriteHeader(http.StatusNoContent)
}
Expand Down Expand Up @@ -198,12 +198,12 @@
}

ctx.Writer.Header().Set("Content-Type", "application/sdp")
ctx.Writer.Header().Set("Access-Control-Expose-Headers", "ETag, ID, Accept-Patch, Link, Location")
ctx.Writer.Header().Set("Access-Control-Expose-Headers", "ETag, ID, Accept-Patch, Link, Location, Access-Control-Allow-Methods")

Check failure on line 201 in internal/servers/webrtc/http_server.go

View workflow job for this annotation

GitHub Actions / golangci_lint

line is 129 characters (lll)
ctx.Writer.Header().Set("ETag", "*")
ctx.Writer.Header().Set("ID", res.sx.uuid.String())
ctx.Writer.Header().Set("Accept-Patch", "application/trickle-ice-sdpfrag")
ctx.Writer.Header()["Link"] = webrtc.LinkHeaderMarshal(servers)
ctx.Writer.Header().Set("Location", sessionLocation(publish, res.sx.secret))
ctx.Writer.Header().Set("Location", ctx.Request.URL.Path + "/" + res.sx.secret.String())

Check failure on line 206 in internal/servers/webrtc/http_server.go

View workflow job for this annotation

GitHub Actions / golangci_lint

File is not `gofmt`-ed with `-s` (gofmt)
ctx.Writer.WriteHeader(http.StatusCreated)
ctx.Writer.Write(res.answer)
}
Expand Down Expand Up @@ -285,7 +285,7 @@
if ctx.Request.Method == http.MethodOptions &&
ctx.Request.Header.Get("Access-Control-Request-Method") != "" {
ctx.Writer.Header().Set("Access-Control-Allow-Methods", "OPTIONS, GET, POST, PATCH, DELETE")
ctx.Writer.Header().Set("Access-Control-Allow-Headers", "Authorization, Content-Type, If-Match")
ctx.Writer.Header().Set("Access-Control-Allow-Headers", "Authorization, Content-Type, If-Match, Access-Control-Allow-Methods, ETag")

Check failure on line 288 in internal/servers/webrtc/http_server.go

View workflow job for this annotation

GitHub Actions / golangci_lint

line is 134 characters (lll)
ctx.Writer.WriteHeader(http.StatusNoContent)
return
}
Expand Down
Loading