-
Notifications
You must be signed in to change notification settings - Fork 2k
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
support query strings in checks #1562
support query strings in checks #1562
Conversation
ca59e3d
to
0d98d36
Compare
@dbresson I might be wrong, but since you are using I think we would want this -
|
I'm pretty sure the hostname and port are not part of the opaque section of a URI. If you're looking at the Go net/url documentation and seeing the opaque example shows the hostname as ignored, that's just because the HTTP request object has Host which overrides the host part of the URL. |
Ugh, I guess I'm wrong, based on this: |
It looks like what we really need is URL.parse on the path, and then use URL.ResolveReference to combine the path and query with the rest of the URL. |
@dbresson What I suggested won't work? From the docs it feels like |
Well, it might work, but I don't think it's right. It wouldn't set the query component of the URL. It would produce an invalid URL object that just happens to produce the correct URL string. |
Yeah, if we use RawPath, we would also have to add the RawQuery to add the query parameters. |
My latest commit is probably closer to something that would work. I don't think it's quite right yet though, I suspect it will break if the path isn't set at all. |
} | ||
url := base.ResolveReference(url.parse(check.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.
Parse
is an exported method.
55fd622
to
e191b0e
Compare
Well, my test seems to pass. I also double checked and path has to have a value for http checks, so there's no problem there. I think the test failures are unrelated to my changes. |
@diptanu Do you have any further feedback? |
@dbresson Thanks! Merged. |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
resolves #1561