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

Fixes CORS for meshtasticd to allow use of clients on other origins #5463

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

liamcottle
Copy link
Contributor

I am receiving 404 Not Found when clients using @meshtastic/js in a web browser make an OPTIONS request to /api/v1/toradio and /api/v1/fromradio on a meshtasticd node when using a custom client on another origin.

This results in not being able to communicate with the node.

#5386 fixed this when connecting to the built in ESP32 server over WiFi, this PR fixes the same thing but for the meshtasticd server as well :)

It seems there was already checks for the options requests, but they wouldn't ever be hit since only GET and POST handlers were registered.

I also changed the http_verb comparison to use strcmp as the == check never passed.

Screenshot 2024-11-27 at 4 31 38 PM

@CLAassistant
Copy link

CLAassistant commented Nov 27, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@caveman99 caveman99 merged commit 601d912 into meshtastic:master Nov 27, 2024
47 checks passed
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

Successfully merging this pull request may close these issues.

3 participants