-
Notifications
You must be signed in to change notification settings - Fork 18
Bug 1723422 - properly handle pagination url #182
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
Conversation
jmrodri
commented
Jun 29, 2019
- set path and query string properly
- fix getNextImageURL parsing of path url
- add unit test for getNextImageURL
* set path and query string properly * fix getNextImageURL parsing of path url * add unit test for getNextImageURL
shawn-hurley
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will fix the problem, just some nits.
registries/adapters/oauth/client.go
Outdated
|
|
||
| // path might be a fully qualified URL and we only want the path | ||
| // and query bits | ||
| thebits, err := url.Parse(path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
personally, I would change the variable name but not a blocker
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to pathAsUrl let me know if that is not okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually changed it to pathAsURL since pathAsUrl pissed off lint :)
registries/adapters/oauth/client.go
Outdated
| return nil, err | ||
| } | ||
|
|
||
| req.URL.Path = thebits.Path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we just set req.URL = thebits?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment on NewRequest states they use the base URL from the client. So I wanted to keep the same functionality.
// NewRequest - creates and returns a *http.Request assuming the GET method.
// The base URL configured on the Client gets used with its Path component
// replaced by the path argument. If a token is available, it is added to the
// request automatically. "Accept: application/json" is added to all requests.
// The caller should customize the request as necessary before using it.