Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(oonimkall.HTTPRequest): URL => Url to fix iOS #1545

Merged
merged 5 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/oonimkall/httpx.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ type HTTPRequest struct {
// Method is the MANDATORY request method.
Method string

// URL is the MANDATORY request URL.
URL string
// Url is the MANDATORY request URL. See https://github.com/ooni/probe/issues/2701
bassosimone marked this conversation as resolved.
Show resolved Hide resolved
Url string
}

// HTTPResponse is an HTTP response.
Expand All @@ -54,7 +54,7 @@ func (sess *Session) HTTPDo(ctx *Context, jreq *HTTPRequest) (*HTTPResponse, err
func (sess *Session) httpDoLocked(ctx *Context, jreq *HTTPRequest) (*HTTPResponse, error) {
clnt := sess.sessp.DefaultHTTPClient()

req, err := http.NewRequestWithContext(ctx.ctx, jreq.Method, jreq.URL, nil)
req, err := http.NewRequestWithContext(ctx.ctx, jreq.Method, jreq.Url, nil)
if err != nil {
return nil, err
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/oonimkall/httpx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestSessionHTTPDo(t *testing.T) {

req := &oonimkall.HTTPRequest{
Method: "GET",
URL: server.URL,
Url: server.URL,
}

sess, err := NewSessionForTesting()
Expand All @@ -55,7 +55,7 @@ func TestSessionHTTPDo(t *testing.T) {

req := &oonimkall.HTTPRequest{
Method: "GET",
URL: "\t", // this URL is invalid
Url: "\t", // this URL is invalid
}

resp, err := sess.HTTPDo(sess.NewContext(), req)
Expand All @@ -75,7 +75,7 @@ func TestSessionHTTPDo(t *testing.T) {

req := &oonimkall.HTTPRequest{
Method: "GET",
URL: server.URL,
Url: server.URL,
}

sess, err := NewSessionForTesting()
Expand Down Expand Up @@ -107,7 +107,7 @@ func TestSessionHTTPDo(t *testing.T) {

req := &oonimkall.HTTPRequest{
Method: "GET",
URL: URL.String(),
Url: URL.String(),
}

sess, err := NewSessionForTesting()
Expand Down Expand Up @@ -142,7 +142,7 @@ func TestSessionHTTPDo(t *testing.T) {

req := &oonimkall.HTTPRequest{
Method: "GET",
URL: server.URL,
Url: server.URL,
}

sess, err := NewSessionForTesting()
Expand Down
Loading