diff --git a/.testdata/sample-file.txt b/.testdata/sample-file.txt index 032120aa..77bcbbf1 100644 --- a/.testdata/sample-file.txt +++ b/.testdata/sample-file.txt @@ -1,3 +1,3 @@ THIS IS A SAMPLE FILE FOR TEST -https://github.com/imroc/req +https://github.com/bertold/req diff --git a/README.md b/README.md index 2e71bd02..26f08659 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@

Simple Go HTTP client with Black Magic
@@ -38,7 +38,7 @@ Full documentation is available on the official website: https://req.cool. You first need [Go](https://go.dev/) installed (version 1.24+ is required), then you can use the below Go command to install req: ``` sh -go get github.com/imroc/req/v3 +go get github.com/bertold/req/v3 ``` **Import** @@ -46,7 +46,7 @@ go get github.com/imroc/req/v3 Import req to your code: ```go -import "github.com/imroc/req/v3" +import "github.com/bertold/req/v3" ``` **Basic Usage** @@ -60,7 +60,7 @@ $ cat main.go package main import ( - "github.com/imroc/req/v3" + "github.com/bertold/req/v3" ) func main() { @@ -79,7 +79,7 @@ $ go run main.go :method: GET :path: /uuid :scheme: https -user-agent: req/v3 (https://github.com/imroc/req/v3) +user-agent: req/v3 (https://github.com/bertold/req/v3) accept-encoding: gzip :status: 200 @@ -97,7 +97,7 @@ access-control-allow-credentials: true 2022/05/19 10:05:09.340974 DEBUG [req] HTTP/1.1 GET https://httpbin.org/uuid GET /uuid HTTP/1.1 Host: httpbin.org -User-Agent: req/v3 (https://github.com/imroc/req/v3) +User-Agent: req/v3 (https://github.com/bertold/req/v3) Accept-Encoding: gzip HTTP/1.1 200 OK @@ -136,7 +136,7 @@ package main import ( "fmt" - "github.com/imroc/req/v3" + "github.com/bertold/req/v3" "log" ) @@ -164,7 +164,7 @@ package main import ( "fmt" - "github.com/imroc/req/v3" + "github.com/bertold/req/v3" "log" "time" ) @@ -187,7 +187,7 @@ func main() { var errMsg ErrorMessage resp, err := client.R(). SetHeader("Accept", "application/vnd.github.v3+json"). // Chainable request settings. - SetPathParam("username", "imroc"). // Replace path variable in url. + SetPathParam("username", "bertold"). // Replace path variable in url. SetSuccessResult(&userInfo). // Unmarshal response body into userInfo automatically if status code is between 200 and 299. SetErrorResult(&errMsg). // Unmarshal response body into errMsg automatically if status code >= 400. EnableDump(). // Enable dump at request level, only print dump content if there is an error or some unknown situation occurs to help troubleshoot. @@ -220,7 +220,7 @@ func main() { Normally it will output (SuccessState): ```txt -roc (https://imroc.cc) +roc (https://bertold.cc) ``` ## More Advanced GET @@ -232,7 +232,7 @@ package main import ( "fmt" - "github.com/imroc/req/v3" + "github.com/bertold/req/v3" "log" "time" ) @@ -274,7 +274,7 @@ func main() { var userInfo UserInfo resp, err := client.R(). SetHeader("Accept", "application/vnd.github.v3+json"). // Chainable request settings - SetPathParam("username", "imroc"). + SetPathParam("username", "bertold"). SetSuccessResult(&userInfo). // Unmarshal response body into userInfo automatically if status code is between 200 and 299. Get("https://api.github.com/users/{username}") @@ -296,7 +296,7 @@ package main import ( "fmt" - "github.com/imroc/req/v3" + "github.com/bertold/req/v3" "log" ) @@ -314,7 +314,7 @@ func main() { var result Result resp, err := client.R(). - SetBody(&Repo{Name: "req", Url: "https://github.com/imroc/req"}). + SetBody(&Repo{Name: "req", Url: "https://github.com/bertold/req"}). SetSuccessResult(&result). Post("https://httpbin.org/post") if err != nil { @@ -337,12 +337,12 @@ func main() { :method: POST :path: /post :scheme: https -user-agent: req/v3 (https://github.com/imroc/req/v3) +user-agent: req/v3 (https://github.com/bertold/req/v3) content-type: application/json; charset=utf-8 content-length: 55 accept-encoding: gzip -{"name":"req","website":"https://github.com/imroc/req"} +{"name":"req","website":"https://github.com/bertold/req"} :status: 200 date: Thu, 19 May 2022 12:11:00 GMT @@ -354,7 +354,7 @@ access-control-allow-credentials: true { "args": {}, - "data": "{\"name\":\"req\",\"website\":\"https://github.com/imroc/req\"}", + "data": "{\"name\":\"req\",\"website\":\"https://github.com/bertold/req\"}", "files": {}, "form": {}, "headers": { @@ -362,19 +362,19 @@ access-control-allow-credentials: true "Content-Length": "55", "Content-Type": "application/json; charset=utf-8", "Host": "httpbin.org", - "User-Agent": "req/v3 (https://github.com/imroc/req/v3)", + "User-Agent": "req/v3 (https://github.com/bertold/req/v3)", "X-Amzn-Trace-Id": "Root=1-628633d4-7559d633152b4307288ead2e" }, "json": { "name": "req", - "website": "https://github.com/imroc/req" + "website": "https://github.com/bertold/req" }, "origin": "103.7.29.30", "url": "https://httpbin.org/post" } ++++++++++++++++++++++++++++++++++++++++++++++++ -data: {"name":"req","url":"https://github.com/imroc/req"} +data: {"name":"req","url":"https://github.com/bertold/req"} ++++++++++++++++++++++++++++++++++++++++++++++++ ``` @@ -387,7 +387,7 @@ package main import ( "fmt" - "github.com/imroc/req/v3" + "github.com/bertold/req/v3" ) type APIResponse struct { @@ -425,7 +425,7 @@ Here is an example of building GitHub's SDK with req, using two styles (`GetUser import ( "context" "fmt" - "github.com/imroc/req/v3" + "github.com/bertold/req/v3" ) type ErrorMessage struct { @@ -502,14 +502,14 @@ func (c *GithubClient) GetUserProfile_Style2(ctx context.Context, username strin ## Contributing -If you have a bug report or feature request, you can [open an issue](https://github.com/imroc/req/issues/new), and [pull requests](https://github.com/imroc/req/pulls) are also welcome. +If you have a bug report or feature request, you can [open an issue](https://github.com/bertold/req/issues/new), and [pull requests](https://github.com/bertold/req/pulls) are also welcome. ## Contact If you have questions, feel free to reach out to us in the following ways: -* [Github Discussion](https://github.com/imroc/req/discussions) -* [Slack](https://imroc-req.slack.com/archives/C03UFPGSNC8) | [Join](https://slack.req.cool/) +* [Github Discussion](https://github.com/bertold/req/discussions) +* [Slack](https://bertold-req.slack.com/archives/C03UFPGSNC8) | [Join](https://slack.req.cool/) ## Sponsors diff --git a/SECURITY.md b/SECURITY.md index 4a5665da..3a8effba 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -6,4 +6,4 @@ req version >= `v3.43.x` ## Reporting a Vulnerability -Email: roc@imroc.cc +Email: roc@bertold.cc diff --git a/client.go b/client.go index e9db4b8c..40cbe947 100644 --- a/client.go +++ b/client.go @@ -21,9 +21,9 @@ import ( utls "github.com/refraction-networking/utls" "golang.org/x/net/publicsuffix" - "github.com/imroc/req/v3/http2" - "github.com/imroc/req/v3/internal/header" - "github.com/imroc/req/v3/internal/util" + "github.com/bertold/req/v3/http2" + "github.com/bertold/req/v3/internal/header" + "github.com/bertold/req/v3/internal/util" "github.com/google/go-querystring/query" ) @@ -557,7 +557,7 @@ func (c *Client) DevMode() *Client { } // SetScheme set the default scheme for client, will be used when -// there is no scheme in the request URL (e.g. "github.com/imroc/req"). +// there is no scheme in the request URL (e.g. "github.com/bertold/req"). func (c *Client) SetScheme(scheme string) *Client { if !util.IsStringEmpty(scheme) { c.scheme = strings.TrimSpace(scheme) diff --git a/client_impersonate.go b/client_impersonate.go index dfa9235e..f8fe70a0 100644 --- a/client_impersonate.go +++ b/client_impersonate.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/imroc/req/v3/http2" + "github.com/bertold/req/v3/http2" utls "github.com/refraction-networking/utls" ) diff --git a/client_test.go b/client_test.go index 8f7bc9b0..1e9e8db0 100644 --- a/client_test.go +++ b/client_test.go @@ -17,8 +17,8 @@ import ( "testing" "time" - "github.com/imroc/req/v3/internal/header" - "github.com/imroc/req/v3/internal/tests" + "github.com/bertold/req/v3/internal/header" + "github.com/bertold/req/v3/internal/tests" "golang.org/x/net/publicsuffix" ) @@ -213,7 +213,7 @@ func TestSetCommonHeadersNonCanonical(t *testing.T) { } func TestSetCommonBasicAuth(t *testing.T) { - c := tc().SetCommonBasicAuth("imroc", "123456") + c := tc().SetCommonBasicAuth("bertold", "123456") tests.AssertEqual(t, "Basic aW1yb2M6MTIzNDU2", c.Headers.Get("Authorization")) } @@ -678,7 +678,7 @@ func TestSetResponseBodyTransformer(t *testing.T) { resp, err := c.R().SetSuccessResult(user).Get("/urlencode") assertSuccess(t, resp, err) tests.AssertEqual(t, user.Username, "我是roc") - tests.AssertEqual(t, user.Email, "roc@imroc.cc") + tests.AssertEqual(t, user.Email, "roc@bertold.cc") } func TestSetResultStateCheckFunc(t *testing.T) { diff --git a/client_wrapper.go b/client_wrapper.go index 74c5312e..b668082b 100644 --- a/client_wrapper.go +++ b/client_wrapper.go @@ -9,7 +9,7 @@ import ( "net/url" "time" - "github.com/imroc/req/v3/http2" + "github.com/bertold/req/v3/http2" utls "github.com/refraction-networking/utls" ) diff --git a/decode.go b/decode.go index 825cffc6..13db557a 100644 --- a/decode.go +++ b/decode.go @@ -1,7 +1,7 @@ package req import ( - "github.com/imroc/req/v3/internal/charsets" + "github.com/bertold/req/v3/internal/charsets" "io" "strings" ) diff --git a/decode_test.go b/decode_test.go index e65a8ea6..9c06e841 100644 --- a/decode_test.go +++ b/decode_test.go @@ -1,7 +1,7 @@ package req import ( - "github.com/imroc/req/v3/internal/tests" + "github.com/bertold/req/v3/internal/tests" "testing" ) diff --git a/digest.go b/digest.go index 0695d8c3..b6c53b96 100644 --- a/digest.go +++ b/digest.go @@ -7,7 +7,7 @@ import ( "sync" "github.com/icholy/digest" - "github.com/imroc/req/v3/internal/header" + "github.com/bertold/req/v3/internal/header" ) // cchal is a cached challenge and the number of times it's been used. diff --git a/dump.go b/dump.go index 77f96349..5de0ec54 100644 --- a/dump.go +++ b/dump.go @@ -1,7 +1,7 @@ package req import ( - "github.com/imroc/req/v3/internal/dump" + "github.com/bertold/req/v3/internal/dump" "io" "os" ) diff --git a/examples/find-popular-repo/README.md b/examples/find-popular-repo/README.md index a95944a8..21200d4a 100644 --- a/examples/find-popular-repo/README.md +++ b/examples/find-popular-repo/README.md @@ -13,5 +13,5 @@ go run . Change the global `username` variable to your own github username: ```go -var username = "imroc" +var username = "bertold" ``` \ No newline at end of file diff --git a/examples/find-popular-repo/go.mod b/examples/find-popular-repo/go.mod index 86ab366e..a89a5d8a 100644 --- a/examples/find-popular-repo/go.mod +++ b/examples/find-popular-repo/go.mod @@ -4,9 +4,9 @@ go 1.24 toolchain go1.24.4 -replace github.com/imroc/req/v3 => ../../ +replace github.com/bertold/req/v3 => ../../ -require github.com/imroc/req/v3 v3.0.0 +require github.com/bertold/req/v3 v3.0.0 require ( github.com/andybalholm/brotli v1.2.0 // indirect diff --git a/examples/find-popular-repo/main.go b/examples/find-popular-repo/main.go index 44708f3b..702befff 100644 --- a/examples/find-popular-repo/main.go +++ b/examples/find-popular-repo/main.go @@ -4,11 +4,11 @@ import ( "fmt" "strconv" - "github.com/imroc/req/v3" + "github.com/bertold/req/v3" ) // Change the name if you want -var username = "imroc" +var username = "bertold" func main() { repo, star, err := findTheMostPopularRepo(username) diff --git a/examples/opentelemetry-jaeger-tracing/README.md b/examples/opentelemetry-jaeger-tracing/README.md index 3dfa4a56..58ee3a6f 100644 --- a/examples/opentelemetry-jaeger-tracing/README.md +++ b/examples/opentelemetry-jaeger-tracing/README.md @@ -17,12 +17,12 @@ go run . Please give a github username: ``` -Input a github username, e.g. `imroc`: +Input a github username, e.g. `bertold`: ```bash $ go run . -Please give a github username: imroc -The moust popular repo of roc (https://imroc.cc) is req, which have 2500 stars +Please give a github username: bertold +The moust popular repo of roc (https://bertold.cc) is req, which have 2500 stars ``` Then enter the Jaeger UI with browser (`http://127.0.0.1:16686/`), checkout the tracing details. diff --git a/examples/opentelemetry-jaeger-tracing/github/github.go b/examples/opentelemetry-jaeger-tracing/github/github.go index b7898301..d8952bb8 100644 --- a/examples/opentelemetry-jaeger-tracing/github/github.go +++ b/examples/opentelemetry-jaeger-tracing/github/github.go @@ -3,7 +3,7 @@ package github import ( "context" "fmt" - "github.com/imroc/req/v3" + "github.com/bertold/req/v3" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace" diff --git a/examples/opentelemetry-jaeger-tracing/go.mod b/examples/opentelemetry-jaeger-tracing/go.mod index eb0dc4ac..c724f2d6 100644 --- a/examples/opentelemetry-jaeger-tracing/go.mod +++ b/examples/opentelemetry-jaeger-tracing/go.mod @@ -4,10 +4,10 @@ go 1.24 toolchain go1.24.4 -replace github.com/imroc/req/v3 => ../../ +replace github.com/bertold/req/v3 => ../../ require ( - github.com/imroc/req/v3 v3.0.0 + github.com/bertold/req/v3 v3.0.0 go.opentelemetry.io/otel v1.9.0 go.opentelemetry.io/otel/exporters/jaeger v1.9.0 go.opentelemetry.io/otel/sdk v1.9.0 diff --git a/examples/upload/uploadclient/go.mod b/examples/upload/uploadclient/go.mod index 3503e383..3a206f84 100644 --- a/examples/upload/uploadclient/go.mod +++ b/examples/upload/uploadclient/go.mod @@ -4,9 +4,9 @@ go 1.24 toolchain go1.24.4 -replace github.com/imroc/req/v3 => ../../../ +replace github.com/bertold/req/v3 => ../../../ -require github.com/imroc/req/v3 v3.0.0 +require github.com/bertold/req/v3 v3.0.0 require ( github.com/andybalholm/brotli v1.2.0 // indirect diff --git a/examples/upload/uploadclient/main.go b/examples/upload/uploadclient/main.go index d9c8fd34..7bd4a566 100644 --- a/examples/upload/uploadclient/main.go +++ b/examples/upload/uploadclient/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/imroc/req/v3" + "github.com/bertold/req/v3" ) func main() { @@ -9,14 +9,14 @@ func main() { req.SetFile("files", "../../../README.md"). SetFile("files", "../../../LICENSE"). SetFormData(map[string]string{ - "name": "imroc", - "email": "roc@imroc.cc", + "name": "bertold", + "email": "roc@bertold.cc", }). Post("http://127.0.0.1:8888/upload") /* Output POST /upload HTTP/1.1 Host: 127.0.0.1:8888 - User-Agent: req/v2 (https://github.com/imroc/req) + User-Agent: req/v2 (https://github.com/bertold/req) Transfer-Encoding: chunked Content-Type: multipart/form-data; boundary=6af1b071a682709355cf5fb15b9cf9e793df7a45e5cd1eb7c413f2e72bf6 Accept-Encoding: gzip @@ -26,6 +26,6 @@ func main() { Date: Tue, 25 Jan 2022 09:40:36 GMT Content-Length: 76 - Uploaded successfully 2 files with fields name=imroc and email=roc@imroc.cc. + Uploaded successfully 2 files with fields name=bertold and email=roc@bertold.cc. */ } diff --git a/examples/uploadcallback/uploadclient/go.mod b/examples/uploadcallback/uploadclient/go.mod index 3503e383..3a206f84 100644 --- a/examples/uploadcallback/uploadclient/go.mod +++ b/examples/uploadcallback/uploadclient/go.mod @@ -4,9 +4,9 @@ go 1.24 toolchain go1.24.4 -replace github.com/imroc/req/v3 => ../../../ +replace github.com/bertold/req/v3 => ../../../ -require github.com/imroc/req/v3 v3.0.0 +require github.com/bertold/req/v3 v3.0.0 require ( github.com/andybalholm/brotli v1.2.0 // indirect diff --git a/examples/uploadcallback/uploadclient/main.go b/examples/uploadcallback/uploadclient/main.go index 19dd217e..c962e606 100644 --- a/examples/uploadcallback/uploadclient/main.go +++ b/examples/uploadcallback/uploadclient/main.go @@ -4,7 +4,7 @@ import ( "fmt" "io" "time" - "github.com/imroc/req/v3" + "github.com/bertold/req/v3" ) type SlowReader struct { diff --git a/go.mod b/go.mod index 20feb67d..c6e7312c 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/imroc/req/v3 +module github.com/bertold/req/v3 go 1.24.0 diff --git a/go.sum b/go.sum index d47c3d19..0ad861c8 100644 --- a/go.sum +++ b/go.sum @@ -3,8 +3,8 @@ github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUS github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= -github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/icholy/digest v1.1.0 h1:HfGg9Irj7i+IX1o1QAmPfIBNu/Q5A5Tu3n/MED9k9H4= diff --git a/header.go b/header.go index 9ded8623..cd4534b7 100644 --- a/header.go +++ b/header.go @@ -10,7 +10,7 @@ import ( "golang.org/x/net/http/httpguts" - "github.com/imroc/req/v3/internal/header" + "github.com/bertold/req/v3/internal/header" ) var headerNewlineToSpace = strings.NewReplacer("\n", " ", "\r", " ") diff --git a/http.go b/http.go index 61a63676..dda9a882 100644 --- a/http.go +++ b/http.go @@ -8,7 +8,7 @@ import ( "net/textproto" "strings" - "github.com/imroc/req/v3/internal/ascii" + "github.com/bertold/req/v3/internal/ascii" "golang.org/x/net/http/httpguts" "golang.org/x/net/idna" ) diff --git a/http_request.go b/http_request.go index 5816de44..018826e8 100644 --- a/http_request.go +++ b/http_request.go @@ -7,8 +7,8 @@ import ( "golang.org/x/net/http/httpguts" - "github.com/imroc/req/v3/internal/ascii" - "github.com/imroc/req/v3/internal/header" + "github.com/bertold/req/v3/internal/ascii" + "github.com/bertold/req/v3/internal/header" ) // Given a string of the form "host", "host:port", or "[ipv6::address]:port", diff --git a/internal/altsvcutil/altsvcutil.go b/internal/altsvcutil/altsvcutil.go index 84978d7e..bfb6c14a 100644 --- a/internal/altsvcutil/altsvcutil.go +++ b/internal/altsvcutil/altsvcutil.go @@ -3,8 +3,8 @@ package altsvcutil import ( "bytes" "fmt" - "github.com/imroc/req/v3/internal/netutil" - "github.com/imroc/req/v3/pkg/altsvc" + "github.com/bertold/req/v3/internal/netutil" + "github.com/bertold/req/v3/pkg/altsvc" "io" "net" "net/url" diff --git a/internal/altsvcutil/altsvcutil_test.go b/internal/altsvcutil/altsvcutil_test.go index 3cbc0019..3118a8c8 100644 --- a/internal/altsvcutil/altsvcutil_test.go +++ b/internal/altsvcutil/altsvcutil_test.go @@ -1,7 +1,7 @@ package altsvcutil import ( - "github.com/imroc/req/v3/internal/tests" + "github.com/bertold/req/v3/internal/tests" "testing" ) diff --git a/internal/charsets/charsets_test.go b/internal/charsets/charsets_test.go index 28cd698a..cf6d1fdb 100644 --- a/internal/charsets/charsets_test.go +++ b/internal/charsets/charsets_test.go @@ -5,7 +5,7 @@ package charsets import ( - "github.com/imroc/req/v3/internal/tests" + "github.com/bertold/req/v3/internal/tests" "os" "runtime" "testing" diff --git a/internal/chunked.go b/internal/chunked.go index dec4ddca..23def209 100644 --- a/internal/chunked.go +++ b/internal/chunked.go @@ -13,7 +13,7 @@ import ( "bytes" "errors" "fmt" - "github.com/imroc/req/v3/internal/util" + "github.com/bertold/req/v3/internal/util" "io" ) diff --git a/internal/godebug/godebug.go b/internal/godebug/godebug.go index f5a0f53a..629b7718 100644 --- a/internal/godebug/godebug.go +++ b/internal/godebug/godebug.go @@ -38,8 +38,8 @@ import ( "sync/atomic" _ "unsafe" // go:linkname - "github.com/imroc/req/v3/internal/bisect" - "github.com/imroc/req/v3/internal/godebugs" + "github.com/bertold/req/v3/internal/bisect" + "github.com/bertold/req/v3/internal/godebugs" ) // A Setting is a single setting in the $GODEBUG environment variable. diff --git a/internal/header/header.go b/internal/header/header.go index 4098febe..51399c2b 100644 --- a/internal/header/header.go +++ b/internal/header/header.go @@ -3,7 +3,7 @@ package header import "strings" const ( - DefaultUserAgent = "req/v3 (https://github.com/imroc/req)" + DefaultUserAgent = "req/v3 (https://github.com/bertold/req)" UserAgent = "User-Agent" Location = "Location" ContentType = "Content-Type" diff --git a/internal/http2/frame.go b/internal/http2/frame.go index 23c10936..5c9215fa 100644 --- a/internal/http2/frame.go +++ b/internal/http2/frame.go @@ -16,8 +16,8 @@ import ( "strings" "sync" - "github.com/imroc/req/v3/http2" - "github.com/imroc/req/v3/internal/dump" + "github.com/bertold/req/v3/http2" + "github.com/bertold/req/v3/internal/dump" "golang.org/x/net/http/httpguts" "golang.org/x/net/http2/hpack" ) diff --git a/internal/http2/headermap.go b/internal/http2/headermap.go index a8e01cf9..06f02538 100644 --- a/internal/http2/headermap.go +++ b/internal/http2/headermap.go @@ -5,7 +5,7 @@ package http2 import ( - "github.com/imroc/req/v3/internal/ascii" + "github.com/bertold/req/v3/internal/ascii" "net/http" "sync" ) diff --git a/internal/http2/transport.go b/internal/http2/transport.go index 3677f190..7126cff1 100644 --- a/internal/http2/transport.go +++ b/internal/http2/transport.go @@ -35,15 +35,15 @@ import ( "golang.org/x/net/http2/hpack" "golang.org/x/net/idna" - "github.com/imroc/req/v3/http2" - "github.com/imroc/req/v3/internal/ascii" - "github.com/imroc/req/v3/internal/common" - "github.com/imroc/req/v3/internal/compress" - "github.com/imroc/req/v3/internal/dump" - "github.com/imroc/req/v3/internal/header" - "github.com/imroc/req/v3/internal/netutil" - "github.com/imroc/req/v3/internal/transport" - reqtls "github.com/imroc/req/v3/pkg/tls" + "github.com/bertold/req/v3/http2" + "github.com/bertold/req/v3/internal/ascii" + "github.com/bertold/req/v3/internal/common" + "github.com/bertold/req/v3/internal/compress" + "github.com/bertold/req/v3/internal/dump" + "github.com/bertold/req/v3/internal/header" + "github.com/bertold/req/v3/internal/netutil" + "github.com/bertold/req/v3/internal/transport" + reqtls "github.com/bertold/req/v3/pkg/tls" ) const ( diff --git a/internal/http3/client.go b/internal/http3/client.go index f8786129..3d6db3af 100644 --- a/internal/http3/client.go +++ b/internal/http3/client.go @@ -12,8 +12,8 @@ import ( "net/textproto" "time" - "github.com/imroc/req/v3/internal/dump" - "github.com/imroc/req/v3/internal/transport" + "github.com/bertold/req/v3/internal/dump" + "github.com/bertold/req/v3/internal/transport" "github.com/quic-go/quic-go" "github.com/quic-go/quic-go/http3/qlog" "github.com/quic-go/quic-go/quicvarint" diff --git a/internal/http3/conn.go b/internal/http3/conn.go index 5e20ce6e..d93db171 100644 --- a/internal/http3/conn.go +++ b/internal/http3/conn.go @@ -13,7 +13,7 @@ import ( "sync/atomic" "time" - "github.com/imroc/req/v3/internal/transport" + "github.com/bertold/req/v3/internal/transport" "github.com/quic-go/quic-go" "github.com/quic-go/quic-go/http3/qlog" "github.com/quic-go/quic-go/qlogwriter" diff --git a/internal/http3/headers.go b/internal/http3/headers.go index ff1ac659..415264c9 100644 --- a/internal/http3/headers.go +++ b/internal/http3/headers.go @@ -11,7 +11,7 @@ import ( "golang.org/x/net/http/httpguts" - "github.com/imroc/req/v3/internal/dump" + "github.com/bertold/req/v3/internal/dump" "github.com/quic-go/qpack" ) diff --git a/internal/http3/request_writer.go b/internal/http3/request_writer.go index 187d58b8..7d0f1c59 100644 --- a/internal/http3/request_writer.go +++ b/internal/http3/request_writer.go @@ -12,8 +12,8 @@ import ( "strings" "sync" - "github.com/imroc/req/v3/internal/dump" - reqheader "github.com/imroc/req/v3/internal/header" + "github.com/bertold/req/v3/internal/dump" + reqheader "github.com/bertold/req/v3/internal/header" "github.com/quic-go/qpack" "github.com/quic-go/quic-go" "github.com/quic-go/quic-go/http3/qlog" diff --git a/internal/http3/stream.go b/internal/http3/stream.go index 025f43e2..2099e4f3 100644 --- a/internal/http3/stream.go +++ b/internal/http3/stream.go @@ -9,9 +9,9 @@ import ( "net/http/httptrace" "time" - "github.com/imroc/req/v3/internal/compress" - "github.com/imroc/req/v3/internal/dump" - "github.com/imroc/req/v3/internal/transport" + "github.com/bertold/req/v3/internal/compress" + "github.com/bertold/req/v3/internal/dump" + "github.com/bertold/req/v3/internal/transport" "github.com/quic-go/quic-go" "github.com/quic-go/quic-go/http3/qlog" "github.com/quic-go/quic-go/qlogwriter" diff --git a/internal/http3/transport.go b/internal/http3/transport.go index ebe4b5b9..727ff403 100644 --- a/internal/http3/transport.go +++ b/internal/http3/transport.go @@ -17,7 +17,7 @@ import ( "golang.org/x/net/http/httpguts" - "github.com/imroc/req/v3/internal/transport" + "github.com/bertold/req/v3/internal/transport" "github.com/quic-go/quic-go" ) diff --git a/internal/socks/socks_test.go b/internal/socks/socks_test.go index 824a09d7..77a458bd 100644 --- a/internal/socks/socks_test.go +++ b/internal/socks/socks_test.go @@ -3,7 +3,7 @@ package socks import ( "bytes" "context" - "github.com/imroc/req/v3/internal/tests" + "github.com/bertold/req/v3/internal/tests" "strings" "testing" ) @@ -23,7 +23,7 @@ func TestReply(t *testing.T) { func TestAuthenticate(t *testing.T) { auth := &UsernamePassword{ - Username: "imroc", + Username: "bertold", Password: "123456", } buf := bytes.NewBuffer([]byte{byte(0x01), byte(0x00)}) @@ -33,7 +33,7 @@ func TestAuthenticate(t *testing.T) { err = auth.Authenticate(context.Background(), buf, AuthMethodUsernamePassword) tests.AssertErrorContains(t, err, "invalid") - auth.Username = "imroc" + auth.Username = "bertold" buf = bytes.NewBuffer([]byte{byte(0x03), byte(0x00)}) err = auth.Authenticate(context.Background(), buf, AuthMethodUsernamePassword) tests.AssertErrorContains(t, err, "invalid username/password version") diff --git a/internal/transport/option.go b/internal/transport/option.go index d45b51c1..fa73e88a 100644 --- a/internal/transport/option.go +++ b/internal/transport/option.go @@ -8,7 +8,7 @@ import ( "net/url" "time" - "github.com/imroc/req/v3/internal/dump" + "github.com/bertold/req/v3/internal/dump" ) // Options is transport's options. diff --git a/logger_test.go b/logger_test.go index 8a456da8..751aeb17 100644 --- a/logger_test.go +++ b/logger_test.go @@ -5,7 +5,7 @@ import ( "log" "testing" - "github.com/imroc/req/v3/internal/tests" + "github.com/bertold/req/v3/internal/tests" ) func TestLogger(t *testing.T) { diff --git a/middleware.go b/middleware.go index 54129d89..c7ee3cfc 100644 --- a/middleware.go +++ b/middleware.go @@ -14,8 +14,8 @@ import ( "strings" "time" - "github.com/imroc/req/v3/internal/header" - "github.com/imroc/req/v3/internal/util" + "github.com/bertold/req/v3/internal/header" + "github.com/bertold/req/v3/internal/util" ) type ( diff --git a/redirect.go b/redirect.go index fcc13e4b..25e59a37 100644 --- a/redirect.go +++ b/redirect.go @@ -34,8 +34,8 @@ func NoRedirectPolicy() RedirectPolicy { } // SameDomainRedirectPolicy allows redirect only if the redirected domain -// is the same as original domain, e.g. redirect to "www.imroc.cc" from -// "imroc.cc" is allowed, but redirect to "google.com" is not allowed. +// is the same as original domain, e.g. redirect to "www.bertold.cc" from +// "bertold.cc" is allowed, but redirect to "google.com" is not allowed. func SameDomainRedirectPolicy() RedirectPolicy { return func(req *http.Request, via []*http.Request) error { if getDomain(req.URL.Host) != getDomain(via[0].URL.Host) { @@ -46,8 +46,8 @@ func SameDomainRedirectPolicy() RedirectPolicy { } // SameHostRedirectPolicy allows redirect only if the redirected host -// is the same as original host, e.g. redirect to "www.imroc.cc" from -// "imroc.cc" is not the allowed. +// is the same as original host, e.g. redirect to "www.bertold.cc" from +// "bertold.cc" is not the allowed. func SameHostRedirectPolicy() RedirectPolicy { return func(req *http.Request, via []*http.Request) error { if getHostname(req.URL.Host) != getHostname(via[0].URL.Host) { diff --git a/req_test.go b/req_test.go index 9942bcb9..506fae27 100644 --- a/req_test.go +++ b/req_test.go @@ -18,8 +18,8 @@ import ( "testing" "unsafe" - "github.com/imroc/req/v3/internal/header" - "github.com/imroc/req/v3/internal/tests" + "github.com/bertold/req/v3/internal/header" + "github.com/bertold/req/v3/internal/tests" "golang.org/x/text/encoding/simplifiedchinese" "golang.org/x/text/transform" ) @@ -199,11 +199,11 @@ func handleSearch(w http.ResponseWriter, r *http.Request) { ErrorCode: 10000, ErrorMessage: "need username", } - case "imroc": + case "bertold": w.WriteHeader(http.StatusOK) result = &UserInfo{ - Username: "imroc", - Email: "roc@imroc.cc", + Username: "bertold", + Email: "roc@bertold.cc", } default: w.WriteHeader(http.StatusNotFound) @@ -242,7 +242,7 @@ func handleGet(w http.ResponseWriter, r *http.Request) { case "/urlencode": info := &UserInfo{ Username: "我是roc", - Email: "roc@imroc.cc", + Email: "roc@bertold.cc", } bs, err := json.Marshal(info) if err != nil { diff --git a/request.go b/request.go index d7695a32..021716ff 100644 --- a/request.go +++ b/request.go @@ -15,9 +15,9 @@ import ( "time" "github.com/google/go-querystring/query" - "github.com/imroc/req/v3/internal/dump" - "github.com/imroc/req/v3/internal/header" - "github.com/imroc/req/v3/internal/util" + "github.com/bertold/req/v3/internal/dump" + "github.com/bertold/req/v3/internal/header" + "github.com/bertold/req/v3/internal/util" ) // Request struct is used to compose and fire individual request from diff --git a/request_test.go b/request_test.go index a1c649a3..6294e23c 100644 --- a/request_test.go +++ b/request_test.go @@ -14,8 +14,8 @@ import ( "testing" "time" - "github.com/imroc/req/v3/internal/header" - "github.com/imroc/req/v3/internal/tests" + "github.com/bertold/req/v3/internal/header" + "github.com/bertold/req/v3/internal/tests" ) func TestMustSendMethods(t *testing.T) { @@ -274,7 +274,7 @@ func TestBadRequest(t *testing.T) { } func TestSetBodyMarshal(t *testing.T) { - username := "imroc" + username := "bertold" type User struct { Username string `json:"username" xml:"username"` } @@ -362,31 +362,31 @@ func TestSetBodyMarshal(t *testing.T) { func TestDoAPIStyle(t *testing.T) { c := tc() user := &UserInfo{} - url := "/search?username=imroc&type=json" + url := "/search?username=bertold&type=json" err := c.Get().SetURL(url).Do().Into(user) tests.AssertEqual(t, true, err == nil) - tests.AssertEqual(t, "imroc", user.Username) + tests.AssertEqual(t, "bertold", user.Username) } func TestSetSuccessResult(t *testing.T) { c := tc() var user *UserInfo - url := "/search?username=imroc&type=json" + url := "/search?username=bertold&type=json" resp, err := c.R().SetSuccessResult(&user).Get(url) assertSuccess(t, resp, err) - tests.AssertEqual(t, "imroc", user.Username) + tests.AssertEqual(t, "bertold", user.Username) user = &UserInfo{} resp, err = c.R().SetSuccessResult(user).Get(url) assertSuccess(t, resp, err) - tests.AssertEqual(t, "imroc", user.Username) + tests.AssertEqual(t, "bertold", user.Username) user = nil resp, err = c.R().SetSuccessResult(user).Get(url) assertSuccess(t, resp, err) - tests.AssertEqual(t, "imroc", resp.Result().(*UserInfo).Username) + tests.AssertEqual(t, "bertold", resp.Result().(*UserInfo).Username) } func TestSetBody(t *testing.T) { @@ -498,7 +498,7 @@ func TestCookie(t *testing.T) { func TestSetBasicAuth(t *testing.T) { headers := make(http.Header) resp, err := tc().R(). - SetBasicAuth("imroc", "123456"). + SetBasicAuth("bertold", "123456"). SetSuccessResult(&headers). Get("/header") assertSuccess(t, resp, err) @@ -687,7 +687,7 @@ func TestPathParam(t *testing.T) { } func testPathParam(t *testing.T, c *Client) { - username := "imroc" + username := "bertold" resp, err := c.R(). SetPathParam("username", username). Get("/user/{username}/profile") @@ -702,20 +702,20 @@ func TestSuccess(t *testing.T) { func testSuccess(t *testing.T, c *Client) { var userInfo UserInfo resp, err := c.R(). - SetQueryParam("username", "imroc"). + SetQueryParam("username", "bertold"). SetSuccessResult(&userInfo). Get("/search") assertSuccess(t, resp, err) - tests.AssertEqual(t, "roc@imroc.cc", userInfo.Email) + tests.AssertEqual(t, "roc@bertold.cc", userInfo.Email) userInfo = UserInfo{} resp, err = c.R(). - SetQueryParam("username", "imroc"). + SetQueryParam("username", "bertold"). SetQueryParam("type", "xml"). // auto unmarshal to xml SetSuccessResult(&userInfo).EnableDump(). Get("/search") assertSuccess(t, resp, err) - tests.AssertEqual(t, "roc@imroc.cc", userInfo.Email) + tests.AssertEqual(t, "roc@bertold.cc", userInfo.Email) } func TestError(t *testing.T) { @@ -766,23 +766,23 @@ func testForm(t *testing.T, c *Client) { var userInfo UserInfo resp, err := c.R(). SetFormData(map[string]string{ - "username": "imroc", + "username": "bertold", "type": "xml", }). SetSuccessResult(&userInfo). Post("/search") assertSuccess(t, resp, err) - tests.AssertEqual(t, "roc@imroc.cc", userInfo.Email) + tests.AssertEqual(t, "roc@bertold.cc", userInfo.Email) v := make(url.Values) - v.Add("username", "imroc") + v.Add("username", "bertold") v.Add("type", "xml") resp, err = c.R(). SetFormDataFromValues(v). SetSuccessResult(&userInfo). Post("/search") assertSuccess(t, resp, err) - tests.AssertEqual(t, "roc@imroc.cc", userInfo.Email) + tests.AssertEqual(t, "roc@bertold.cc", userInfo.Email) } func TestHostHeaderOverride(t *testing.T) { diff --git a/response.go b/response.go index 69aee127..33cd38b6 100644 --- a/response.go +++ b/response.go @@ -6,8 +6,8 @@ import ( "strings" "time" - "github.com/imroc/req/v3/internal/header" - "github.com/imroc/req/v3/internal/util" + "github.com/bertold/req/v3/internal/header" + "github.com/bertold/req/v3/internal/util" ) // Response is the http response. diff --git a/retry_test.go b/retry_test.go index 5814b5fe..7699743a 100644 --- a/retry_test.go +++ b/retry_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/imroc/req/v3/internal/tests" + "github.com/bertold/req/v3/internal/tests" ) func TestRetryBackOff(t *testing.T) { diff --git a/roundtrip_js.go b/roundtrip_js.go index 958d9a4b..b6d6bd8c 100644 --- a/roundtrip_js.go +++ b/roundtrip_js.go @@ -15,7 +15,7 @@ import ( "strings" "syscall/js" - "github.com/imroc/req/v3/internal/ascii" + "github.com/bertold/req/v3/internal/ascii" ) var uint8Array = js.Global().Get("Uint8Array") diff --git a/textproto_reader.go b/textproto_reader.go index 64f3bb28..66bc31a3 100644 --- a/textproto_reader.go +++ b/textproto_reader.go @@ -13,7 +13,7 @@ import ( "net/textproto" "sync" - "github.com/imroc/req/v3/internal/dump" + "github.com/bertold/req/v3/internal/dump" ) func isASCIILetter(b byte) bool { diff --git a/transfer.go b/transfer.go index 6af7431c..8838a09e 100644 --- a/transfer.go +++ b/transfer.go @@ -19,10 +19,10 @@ import ( "sync" "time" - "github.com/imroc/req/v3/internal" - "github.com/imroc/req/v3/internal/ascii" - "github.com/imroc/req/v3/internal/dump" - "github.com/imroc/req/v3/internal/godebug" + "github.com/bertold/req/v3/internal" + "github.com/bertold/req/v3/internal/ascii" + "github.com/bertold/req/v3/internal/dump" + "github.com/bertold/req/v3/internal/godebug" "golang.org/x/net/http/httpguts" ) diff --git a/transport.go b/transport.go index 1c549b16..d34ecfb6 100644 --- a/transport.go +++ b/transport.go @@ -32,21 +32,21 @@ import ( "time" _ "unsafe" - "github.com/imroc/req/v3/http2" - "github.com/imroc/req/v3/internal/altsvcutil" - "github.com/imroc/req/v3/internal/ascii" - "github.com/imroc/req/v3/internal/common" - "github.com/imroc/req/v3/internal/compress" - "github.com/imroc/req/v3/internal/dump" - "github.com/imroc/req/v3/internal/header" - h2internal "github.com/imroc/req/v3/internal/http2" - "github.com/imroc/req/v3/internal/http3" - "github.com/imroc/req/v3/internal/netutil" - "github.com/imroc/req/v3/internal/socks" - "github.com/imroc/req/v3/internal/transport" - "github.com/imroc/req/v3/internal/util" - "github.com/imroc/req/v3/pkg/altsvc" - reqtls "github.com/imroc/req/v3/pkg/tls" + "github.com/bertold/req/v3/http2" + "github.com/bertold/req/v3/internal/altsvcutil" + "github.com/bertold/req/v3/internal/ascii" + "github.com/bertold/req/v3/internal/common" + "github.com/bertold/req/v3/internal/compress" + "github.com/bertold/req/v3/internal/dump" + "github.com/bertold/req/v3/internal/header" + h2internal "github.com/bertold/req/v3/internal/http2" + "github.com/bertold/req/v3/internal/http3" + "github.com/bertold/req/v3/internal/netutil" + "github.com/bertold/req/v3/internal/socks" + "github.com/bertold/req/v3/internal/transport" + "github.com/bertold/req/v3/internal/util" + "github.com/bertold/req/v3/pkg/altsvc" + reqtls "github.com/bertold/req/v3/pkg/tls" htmlcharset "golang.org/x/net/html/charset" "golang.org/x/text/encoding/ianaindex"