Skip to content

Conversation

@cpatulea
Copy link
Contributor

@cpatulea cpatulea commented Jan 15, 2026

Before this (missing response):
$ curl -v -X OPTIONS http://meshtastic.local/api/v1/fromradio

  • Host meshtastic.local:80 was resolved.
  • IPv6: (none)
  • IPv4: 192.168.0.19
  • Trying 192.168.0.19:80...
  • Connected to meshtastic.local (192.168.0.19) port 80
  • using HTTP/1.x

OPTIONS /api/v1/fromradio HTTP/1.1
Host: meshtastic.local
User-Agent: curl/8.14.1
Accept: /

  • Request completely sent off
  • Empty reply from server
  • shutting down connection #0 curl: (52) Empty reply from server

After this (proper HTTP 204 response):
$ curl -v -X OPTIONS http://meshtastic.local/api/v1/fromradio

  • Host meshtastic.local:80 was resolved.
  • IPv6: (none)
  • IPv4: 192.168.0.19
  • Trying 192.168.0.19:80...
  • Connected to meshtastic.local (192.168.0.19) port 80
  • using HTTP/1.x

OPTIONS /api/v1/fromradio HTTP/1.1
Host: meshtastic.local
User-Agent: curl/8.14.1
Accept: /

This is related to #5385.

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)

@thebentern thebentern requested a review from Copilot January 15, 2026 12:17
@thebentern thebentern added the bugfix Pull request that fixes bugs label Jan 15, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes an HTTP protocol issue where OPTIONS requests to the /api/v1/fromradio endpoint were not receiving a proper HTTP response, causing clients to receive "Empty reply from server" errors. The fix enables proper CORS preflight request handling by uncommenting the res->print("") call needed to trigger the HTTP response with the esp32_https_server library.

Changes:

  • Uncommented res->print("") in the OPTIONS handler for /api/v1/fromradio to ensure a proper HTTP 204 response is sent

@cpatulea cpatulea force-pushed the http branch 2 times, most recently from 42c06ff to ba8cd78 Compare January 15, 2026 22:47
Before this (missing response):
$ curl -v -X OPTIONS http://meshtastic.local/api/v1/fromradio
* Host meshtastic.local:80 was resolved.
* IPv6: (none)
* IPv4: 192.168.0.19
*   Trying 192.168.0.19:80...
* Connected to meshtastic.local (192.168.0.19) port 80
* using HTTP/1.x
> OPTIONS /api/v1/fromradio HTTP/1.1
> Host: meshtastic.local
> User-Agent: curl/8.14.1
> Accept: */*
>
* Request completely sent off
* Empty reply from server
* shutting down connection #0
curl: (52) Empty reply from server

After this (proper HTTP 204 response):
$ curl -v -X OPTIONS http://meshtastic.local/api/v1/fromradio
* Host meshtastic.local:80 was resolved.
* IPv6: (none)
* IPv4: 192.168.0.19
*   Trying 192.168.0.19:80...
* Connected to meshtastic.local (192.168.0.19) port 80
* using HTTP/1.x
> OPTIONS /api/v1/fromradio HTTP/1.1
> Host: meshtastic.local
> User-Agent: curl/8.14.1
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 204 OK
< Content-Type: application/x-protobuf
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET
< X-Protobuf-Schema: https://raw.githubusercontent.com/meshtastic/protobufs/master/meshtastic/mesh.proto
<
* Connection #0 to host meshtastic.local left intact

This is related to meshtastic#5385.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants