Skip to content

Missing charset in Content-Type header for workers static assets when deployed #9599

Open
@azrdn

Description

@azrdn

What versions & operating system are you using?

Wrangler 4.20.0, Node v22.16.0, Fedora 42 Workstation

Please provide a link to a minimal reproduction

https://github.com/azrdn/azrd.dev/tree/cicada

Describe the Bug

On local wrangler development, the charset in header exists, but not after deployed
Doesn't match default pages behaviour, and results in garbled text when viewed in browser

Please provide any relevant error logs

azrd@fedora in ~
↪ curl -I http://localhost:8787/robots.txt
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Cache-Control: public, max-age=0, must-revalidate
ETag: "63ac36e7ea7c3b25b65a9a51ce23370d"
CF-Cache-Status: HIT
content-security-policy: object-src 'none'; frame-ancestors 'none'; upgrade-insecure-requests
cross-origin-opener-policy: same-origin
referrer-policy: no-referrer
x-robots-tag: noarchive

azrd@fedora in ~
↪ curl -I https://web.azrd.workers.dev/robots.txt
HTTP/2 200 
date: Fri, 13 Jun 2025 09:26:31 GMT
content-type: text/plain
cf-ray: 94f08bfc091b46f7-SIN
cf-cache-status: HIT
cache-control: public, max-age=0, must-revalidate
etag: "f78716248fc6d4316d80b767b0a4867f"
content-security-policy: object-src 'none'; frame-ancestors 'none'; upgrade-insecure-requests
cross-origin-opener-policy: same-origin
referrer-policy: no-referrer
x-robots-tag: noarchive
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=YxZzJSJ7scgRVqxvrvxeXQf%2BQJZC7WqbnTgxLrSKtmaqvVREJ0WVmVgFFHfrO7TUXK6HX7oc3Z4hUQKKLeV%2BL4z8o1w3%2BBWK92Gl6nC9NXXPIoU60l8vZ9uAIVzVSrRnfk1h%2Bd0w9w%3D%3D"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
alt-svc: h3=":443"; ma=86400
server-timing: cfL4;desc="?proto=TCP&rtt=38699&min_rtt=36550&rtt_var=9700&sent=10&recv=15&lost=0&retrans=0&sent_bytes=3400&recv_bytes=772&delivery_rate=95366&cwnd=253&unsent_bytes=0&cid=d59f40f32757bebf&ts=93&x=0"

azrd@fedora in ~
↪ curl -I https://azrd.pages.dev/robots.txt
HTTP/2 200 
date: Fri, 13 Jun 2025 09:26:40 GMT
content-type: text/plain; charset=utf-8
cf-ray: 94f08c35dd8b407f-SIN
access-control-allow-origin: *
cache-control: public, max-age=0, must-revalidate
etag: "f78716248fc6d4316d80b767b0a4867f"
content-security-policy: object-src 'none'; frame-ancestors 'none'; upgrade-insecure-requests
cross-origin-opener-policy: same-origin
referrer-policy: no-referrer
x-content-type-options: nosniff
x-robots-tag: noarchive
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=AAOjl3OHhmSVZxGVaVnt%2FyTya2ah8215377LY2J1GFvPKtJ3%2BYnuOQnI%2FS%2BexYpVpe6TzVWzuzoOIlTCLxfLc%2FkbSCOE3JRsUIvRy9vMHAPFSj3cj3zmX5ip5xivsN%2FfjA%3D%3D"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
alt-svc: h3=":443"; ma=86400
server-timing: cfL4;desc="?proto=TCP&rtt=36290&min_rtt=33302&rtt_var=9988&sent=7&recv=9&lost=0&retrans=0&sent_bytes=3398&recv_bytes=768&delivery_rate=92638&cwnd=253&unsent_bytes=0&cid=8eb864fadabe4998&ts=444&x=0"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that isn't working

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions