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

Regression: API URL handling changed with release 1.1.0 #75

Closed
GermanCoding opened this issue Nov 22, 2022 · 9 comments
Closed

Regression: API URL handling changed with release 1.1.0 #75

GermanCoding opened this issue Nov 22, 2022 · 9 comments

Comments

@GermanCoding
Copy link

Before commit bac4814, runitor would always append a / to the given API URL (-api-url or HC_API_URL). Since the stated commit this is no longer the case and given URL's are treated as-is, without appending a /. This can result in a breaking change, creating 404 errors due to invalid ping URLs being generated.

Examples:

runitor 1.0.0 behaviour:

HC_API_URL="https://healthchecks.example.com/ping/"
runitor --uuid foobar

generated final request URL:

https://healthchecks.example.com/ping//foobar (double slash is not removed, but usually automatically fixed/ignored by webservers)

HC_API_URL="https://healthchecks.example.com/ping" (no final slash)
runitor --uuid foobar

generated final request URL:

https://healthchecks.example.com/ping/foobar (one / automatically appended)

runitor 1.1.0 behaviour:

HC_API_URL="https://healthchecks.example.com/ping/"
runitor --uuid foobar

generates final request URL:

https://healthchecks.example.com/ping/foobar?rid=runid (single slash)

HC_API_URL="https://healthchecks.example.com/ping" (no final slash)
runitor --uuid foobar

generates final request URL:

https://healthchecks.example.com/pingfoobar?rid=runid (zero slashes used. Likely results in invalid URLs, generates 404 errors)

@Derkades
Copy link

Thank you for opening this issue, this explains why my checks are failing after updating to 1.1.0

@bdd
Copy link
Owner

bdd commented Nov 22, 2022 via email

@GermanCoding
Copy link
Author

All good, thanks for caring!

I do have GitHub release notifications on actually, but I often tend to ignore prereleases. I always feel like I won't have the time to manually test them properly, so I naturally tend to just rely on stable releases. Of course when everyone does that the prerelease becomes useless - a typical issue with these types of projects.

For the future I'm going to try and setup a beta/RC channel for runitor. I have recently setup a Debian package for runitor (https://github.com/GermanCoding/runitor) sourced from official releases (it actually just repackages the official binary so signatures are preserved - it's not build from source). Then I will look into running a few runitor beta's here and there.

@bdd
Copy link
Owner

bdd commented Nov 23, 2022

This may take a couple more hours.
One of the YubiKeys I use for signing releases that I packed for travel seems to be dead.
An alternate solution is on the way.

@bdd
Copy link
Owner

bdd commented Nov 23, 2022

@Derkades
Copy link

Thank you for your quick action! Especially considering your circumstances. Anyway, I have tested the release candidate and it appears to work (with the / suffix removed)

GermanCoding pushed a commit to GermanCoding/runitor that referenced this issue Nov 23, 2022
GermanCoding added a commit to GermanCoding/runitor that referenced this issue Nov 23, 2022
v1.1.1-rc.1

Bugfix:
- Fixes bdd#75
@GermanCoding
Copy link
Author

GermanCoding commented Nov 23, 2022

Yes, I can also confirm that this fix works. In addition, the double slash is now also a single slash in both cases:

runitor 1.1.1-rc.1 behaviour:

HC_API_URL="https://healthchecks.example.com/ping/"
runitor --uuid foobar

generates final request URL:

https://healthchecks.example.com/ping/foobar?rid=runid (single slash)

HC_API_URL="https://healthchecks.example.com/ping" (no final slash)
runitor --uuid foobar

generates final request URL:

https://healthchecks.example.com/ping/foobar?rid=runid (also single slash)

In fact, any number of trailing slashes are coalesced into a single slash:

HC_API_URL="https://healthchecks.example.com/ping/////////////"
runitor --uuid foobar
https://healthchecks.example.com/ping/foobar?rid=runid

Do you want this closed now or on final release?

@bdd
Copy link
Owner

bdd commented Nov 23, 2022

Thanks for confirming.

Do you want this closed now or on final release?

I'll close it when 1.1.1 is out.

@bdd
Copy link
Owner

bdd commented Nov 23, 2022

v1.1.1 is out.
Go module v1.1.0 retracted.

https://github.com/bdd/runitor/releases/tag/v1.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants