The local Tedee Bridge API closes a persistent HTTP/1.1 connection without sending a response when a `POST /v1.0/callback` request follows a `GET /v1.0/callback` request on the same connection.
This prevents clients that reuse HTTP connections, including Java’s `HttpClient`, from registering a callback. The client receives an EOF instead of an HTTP response.
Expected Behavior
The Bridge should return an HTTP response to the POST request on a valid persistent connection. With an invalid token, the expected response is `401 Unauthorized`.
Alternatively, if persistent connections are unsupported, the Bridge should explicitly send `Connection: close` in the response to the preceding request.
Actual Behavior
The initial GET returns `401 Unauthorized` and leaves the HTTP connection open. The Bridge then closes that reused connection after receiving the POST request, without returning headers or a response body.
The same POST succeeds when sent through a newly established connection and returns `401 Unauthorized`, confirming that the endpoint, network path, and JSON request body are valid.
Reproduction
Run the following command from a host that can reach the Bridge. Replace the IP address and callback URL as appropriate:
curl -v \ -H 'api_token: invalid' \ ``http://10.0.1.24/v1.0/callback`` \ --next \ -X POST ``http://10.0.1.24/v1.0/callback`` \ -H 'Content-Type: application/json' \ -H 'api_token: invalid' \ --data '{"url":"``http://10.0.0.2:9001/tedee/events","method":"POST","headers":[{"headerName":"X-Tedee-Callback-Secret:`` test"}]}'
Relevant curl output:
`* Reusing existing http: connection with host 10.0.1.24
POST /v1.0/callback HTTP/1.1
…
- Connection died, retrying a fresh connect`
After curl opens a fresh connection, the same POST receives:
HTTP/1.1 401 Unauthorized
{"error-description":"Invalid token"}
Client Error
Java’s `HttpClient` reports the closed reused connection as:
java.io.IOException: HTTP/1.1 header parser received no bytes
Caused by: java.io.EOFException: EOF reached while reading
Request
Could you confirm whether persistent HTTP/1.1 connections are supported by the local Bridge API? If they are supported, please investigate why the Bridge closes the connection before responding to `POST /v1.0/callback` after `GET /v1.0/callback`.