returned url variable name

This commit is contained in:
klutrem
2025-03-06 16:08:43 +03:00
parent b8390331af
commit 22bf8163cd
+4 -4
View File
@@ -5,7 +5,7 @@ import (
"encoding/json" "encoding/json"
"io" "io"
"net/http" "net/http"
"net/url" urlParser "net/url"
"strconv" "strconv"
"strings" "strings"
"time" "time"
@@ -64,8 +64,8 @@ func syncHandler(w http.ResponseWriter, r *http.Request) {
// 2. application/sdp - receive/response SDP via WebRTC-HTTP Egress Protocol (WHEP) // 2. application/sdp - receive/response SDP via WebRTC-HTTP Egress Protocol (WHEP)
// 3. other - receive/response raw SDP // 3. other - receive/response raw SDP
func outputWebRTC(w http.ResponseWriter, r *http.Request) { func outputWebRTC(w http.ResponseWriter, r *http.Request) {
uri := r.URL.Query().Get("src") url := r.URL.Query().Get("src")
stream := streams.Get(uri) stream := streams.Get(url)
if stream == nil { if stream == nil {
http.Error(w, api.StreamNotFound, http.StatusNotFound) http.Error(w, api.StreamNotFound, http.StatusNotFound)
return return
@@ -96,7 +96,7 @@ func outputWebRTC(w http.ResponseWriter, r *http.Request) {
http.Error(w, err.Error(), http.StatusInternalServerError) http.Error(w, err.Error(), http.StatusInternalServerError)
return return
} }
values, err := url.ParseQuery(string(body)) values, err := urlParser.ParseQuery(string(body))
if err != nil { if err != nil {
log.Error().Err(err).Caller().Send() log.Error().Err(err).Caller().Send()
http.Error(w, err.Error(), http.StatusBadRequest) http.Error(w, err.Error(), http.StatusBadRequest)