fix: problems with hardcoded http URLs #42
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the actual backend protocol to the options object we hack in, and replaces any occurrences of "http://" + host the client likes to do with the correct protocol.
Fixes loading map tiles through http even though the backend is server over https (making it rely on having an accessible http version, which might not exist).
To reproduce, open http://pandascreeps.localhost:8080/(https://server.pandascreeps.com/)/#!/map/shard0?pos=2.46,3.046 and http://pandascreeps.localhost:8080/(https://server.pandascreeps.com/)/#!/profile/Gadjung. Make sure you don't get redirected to the http version when logging in, I had that happen and it's confusing.
Before the patch, the first one can be observed loading map tiles through http://server.pandascreeps.com:21025/assets/map/W0S1.png?bust=1739218060553, which happens to work but isn't technically correct.
Note that I've checked the map and profile page, but that's about it. 🤞 I'm not catching something else in the middle of that batch-rewrite.