fix: make the non-WebSocket HTTP redirect target configurable - #4
Merged
Merged
Conversation
The broker only speaks MQTT-over-WS; a plain browser request is redirected to the front-end. Replace the hardcoded analyzer.letsmesh.net 301 with a configurable HTTP_REDIRECT_URL (302), defaulting to https://observers.dutchmeshcore.nl/.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
The broker only speaks MQTT-over-WebSocket. When a plain browser request (no WebSocket upgrade) hits the endpoint, it was 301-redirected to a hardcoded
analyzer.letsmesh.net.Make the redirect target configurable via
HTTP_REDIRECT_URL(defaults tohttps://observers.dutchmeshcore.nl/), and use a 302 instead of a 301 so the redirect is not cached permanently by browsers.Why
The hardcoded host is not the right front-end for this deployment, and a permanent 301 is sticky in browser caches. Config-driven is one line to change per deployment.
Changes
src/server.ts—HTTP_REDIRECT_URLenv (defaultobservers.dutchmeshcore.nl), 301 to 302..env.example— documentHTTP_REDIRECT_URL.No behavioural change to MQTT auth, topics, or forwarding.
tsc --noEmitclean.