Skip to content

Commit 0b97b0d

Browse files
committed
toradio, fromradio OPTIONS handler: fix sending proper HTTP response.
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 #5385.
1 parent d493f5f commit 0b97b0d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mesh/http/ContentHandler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ void handleAPIv1FromRadio(HTTPRequest *req, HTTPResponse *res)
173173

174174
if (req->getMethod() == "OPTIONS") {
175175
res->setStatusCode(204); // Success with no content
176-
// res->print(""); @todo remove
176+
res->print("");
177177
return;
178178
}
179179

@@ -223,7 +223,7 @@ void handleAPIv1ToRadio(HTTPRequest *req, HTTPResponse *res)
223223

224224
if (req->getMethod() == "OPTIONS") {
225225
res->setStatusCode(204); // Success with no content
226-
// res->print(""); @todo remove
226+
res->print("");
227227
return;
228228
}
229229

0 commit comments

Comments
 (0)