mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 11:11:30 -04:00
refactor: change deprecated "io/ioutil" package to recommended "io" package
This commit is contained in:
parent
35984c0876
commit
acce1f1fd9
14 changed files with 25 additions and 39 deletions
|
@ -13,7 +13,6 @@ import (
|
|||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
|
@ -110,7 +109,7 @@ func makePeerConnectionFromOffer(stunURL string, sdp *webrtc.SessionDescription,
|
|||
|
||||
func probeHandler(stunURL string, w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||
resp, err := ioutil.ReadAll(http.MaxBytesReader(w, r.Body, readLimit))
|
||||
resp, err := io.ReadAll(http.MaxBytesReader(w, r.Body, readLimit))
|
||||
if nil != err {
|
||||
log.Println("Invalid data.")
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue