forked from quic-go/quic-go
fix the /dynamic endpoint on the example server
This commit is contained in:
@@ -143,7 +143,7 @@ func setupHandler(www string, trace bool) http.Handler {
|
|||||||
</form></body></html>`)
|
</form></body></html>`)
|
||||||
})
|
})
|
||||||
|
|
||||||
http.HandleFunc("/dynamic/", func(w http.ResponseWriter, r *http.Request) {
|
mux.HandleFunc("/dynamic/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
const maxSize = 1 << 30 // 1 GB
|
const maxSize = 1 << 30 // 1 GB
|
||||||
num, err := strconv.ParseInt(strings.ReplaceAll(r.RequestURI, "/dynamic/", ""), 10, 64)
|
num, err := strconv.ParseInt(strings.ReplaceAll(r.RequestURI, "/dynamic/", ""), 10, 64)
|
||||||
if err != nil || num <= 0 || num > maxSize {
|
if err != nil || num <= 0 || num > maxSize {
|
||||||
|
|||||||
Reference in New Issue
Block a user