mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2025-07-06 05:43:53 +02:00
Do not allow \ or @ in URL
This commit is contained in:
@ -8,6 +8,7 @@ import (
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/markbates/pkger"
|
||||
@ -17,6 +18,11 @@ import (
|
||||
"gitlab.crans.org/nounous/ghostream/stream/webrtc"
|
||||
)
|
||||
|
||||
var (
|
||||
// Precompile regex
|
||||
validPath = regexp.MustCompile("^/[a-z0-9_-]*$")
|
||||
)
|
||||
|
||||
// Handle WebRTC session description exchange via POST
|
||||
func viewerPostHandler(w http.ResponseWriter, r *http.Request) {
|
||||
// Limit response body to 128KB
|
||||
|
Reference in New Issue
Block a user