Skip to content

Commit 86102f4

Browse files
committed
Use io instead of ioutil
1 parent a0d4196 commit 86102f4

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

FlashpointGameServer

9.15 MB
Binary file not shown.

main.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"flag"
99
"fmt"
1010
"io"
11-
"io/ioutil"
1211
"log"
1312
"net"
1413
"net/http"
@@ -205,7 +204,7 @@ func handleRequest(r *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http
205204
// Remove port from host if exists (old apps don't clean it before sending requests?)
206205
r.URL.Host = strings.Split(r.URL.Host, ":")[0]
207206
// Clone the body into both requests by reading and making 2 new readers
208-
contents, _ := ioutil.ReadAll(r.Body)
207+
contents, _ := io.ReadAll(r.Body)
209208

210209
// Copy the original request
211210
gamezipRequest := &http.Request{
@@ -249,7 +248,7 @@ func handleRequest(r *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http
249248
Body: nil,
250249
}
251250
// Copy in a new body reader
252-
legacyRequest.Body = ioutil.NopCloser(bytes.NewReader(contents))
251+
legacyRequest.Body = io.NopCloser(bytes.NewReader(contents))
253252

254253
// Choose which legacy method we're using
255254
if serverSettings.HandleLegacyRequests {

0 commit comments

Comments
 (0)