š BUG: `pages dev` HTTP 406 on `env.ASSETS.fetch()`
See original GitHub issueWhat version of Wrangler
are you using?
0.0.15
What operating system are you using?
Windows
Describe the Bug
Try this:
export const onRequestGet: PagesFunction<{}> = async ({ request, env, next, data, params }) => {
const cloned = request.clone();
const dest = `https://some-page.dev/`;
return env.ASSETS.fetch(new Request(dest, { headers: cloned.headers }));
};
Run wrangler pages dev ./
Works as expected on Wrangler, fetches the index page for https://some-page.dev/
. On Pages, env.ASSETS.fetch()
returns a 406
error with no body. Iāve confirmed that it is env.ASSETS.fetch()
thatās returning the error, and that the worker isnāt just dying.
Hereās an example response:
"response": {
"status": 406,
"statusText": "",
"httpVersion": "h3",
"headers": [
{
"name": "date",
"value": "Tue, 01 Feb 2022 23:53:01 GMT"
},
{
"name": "content-length",
"value": "0"
},
{
"name": "expect-ct",
"value": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""
},
{
"name": "report-to",
"value": "{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=SEj8%2BhNNl%2F31mCPN76ltZtRFew7hoKTHlFyXPakdNoR2dpBUfCsl%2FaDStznbbAG6ZtmGQaCrIGJpV9fr3QFs%2BubBDV5Hi8fRKNLq3LB6sBCB3wUTt5Paa63t%2FN6Yz9djp6NE\"}],\"group\":\"cf-nel\",\"max_age\":604800}"
},
{
"name": "nel",
"value": "{\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}"
},
{
"name": "vary",
"value": "Accept-Encoding"
},
{
"name": "cf-cache-status",
"value": "DYNAMIC"
},
{
"name": "server",
"value": "cloudflare"
},
{
"name": "cf-ray",
"value": "6d6f18c83c5e840e-YVR"
},
{
"name": "alt-svc",
"value": "h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400"
}
],
"cookies": [],
"content": {
"size": 0,
"mimeType": "text/plain"
},
"redirectURL": "",
"headersSize": -1,
"bodySize": -1,
"_transferSize": 514,
"_error": "net::ERR_HTTP_RESPONSE_CODE_FAILURE"
},
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Response "406 unacceptable" on env.ASSETS.fetch() for ...
Hi all, i am having a hard time debugging an issue while using Cloudflare pages functions. In a nutshell, at some point in...
Read more >How to Fix a 406 Error and Find the Source of the Problem
The good news is that the HTTP error ā406 Not Acceptableā message is not nearly as common as the 404 server error (which...
Read more >406 Not Acceptable: What It Is and How to Fix It - Airbrake Blog
The 406 Not Acceptable is an HTTP response status code indicating that the client has requested a response using Accept- headers that theĀ ......
Read more >Guidelines for Environmental Infection Control in Health-Care ...
pages ] (http://www.cdc.gov/hicpac/pdf/2018-Nov-HICPAC-Meeting-508.pdf). ... the negative pressure setting, and because of the potential for error associated.
Read more >Changelog - Miniflare
Return Durable Object get() s in lexicographic order. ... Fix delivery of incoming WebSocket error events; Ensure only scheduled Durable Object alarms areĀ ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This impacted another user in the Discord today: https://canary.discord.com/channels/595317990191398933/910978223968518144/1004857593656786974
Can we get some eyeballs on this issue please? Itās a massive prod vs development issue when doing anything slightly advanced within Functions.
This doesnāt just impact
env.ASSETS.fetch
. The following also triggers a 406, with an accompanyingtest.html
file: