diff options
| author | unwox <me@unwox.com> | 2025-02-03 15:44:36 +0600 |
|---|---|---|
| committer | unwox <me@unwox.com> | 2025-02-03 15:44:36 +0600 |
| commit | 5e9fb54aaedcf5949e42c0d8e7a25093bdc6ac14 (patch) | |
| tree | a14baf6b0f6dbc79af0d8349a0b295db4de790da /main.go | |
| parent | ef75533bc54fdaa84dbb1e4a3a213af57fad3915 (diff) | |
do not follow redirect when calling luna.http.request
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -37,7 +37,12 @@ func main() { } luaArgv := flag.Args() mustExist(luaArgv[0]) - httpClient := &http.Client{} + httpClient := &http.Client{ + // do not follow redirects + CheckRedirect: func(req *http.Request, via []*http.Request) error { + return http.ErrUseLastResponse + }, + } // queue for http messages for workers to handle msgs := make(chan *HTTPRequest, 4096) |
