browserless
browserless copied to clipboard
Sending an explicit Accept header to /function results in 404
Describe the bug
When using the chromium:v2.27.0 image in Docker, the /function endpoint returns a 404 when an Accept header is sent.
To Reproduce Steps to reproduce the behavior:
- Deploy
ghcr.io/browserless/chromium:v2.27.0image in Docker - Send a cURL request as defined below with
Accept: application/jsonheader - Get a 404 response
- Send the same cURL request with an
Accept: */*header - Get a 200 response
curl 'http://localhost:3000/function?token=XXX' \
-X POST \
-H 'Accept: application/json' \
-H 'Content-Type: application/javascript' \
-d'
export default async function ({ page }) {
return {
data: { key: "value" },
type: "application/json"
};
};
'
Expected behavior The request should be accepted and the response should be correct with a 200 OK code.
Additional context The logs indicate the following:
browserless.io:server:trace Handling inbound HTTP request on "POST: /function?token=XXX" +3m
browserless.io:server:error No matching HTTP route handler for "POST: http://0.0.0.0:3000/function?token=XXX&launch=%7B%7D" +3m