{"id":16247208,"url":"https://github.com/dotnetcarpenter/bug-firefox-fetch-cors","last_synced_at":"2026-03-18T18:38:23.829Z","repository":{"id":66935910,"uuid":"477409320","full_name":"dotnetCarpenter/bug-firefox-fetch-cors","owner":"dotnetCarpenter","description":"Test-case for bug in the Fetch implementation in Firefox where the range header is not recognized as a CORS-safelisted request-header.","archived":false,"fork":false,"pushed_at":"2022-04-03T18:34:47.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T19:07:45.739Z","etag":null,"topics":["bugreport","firefox-browser"],"latest_commit_sha":null,"homepage":"https://dotnetcarpenter.github.io/bug-firefox-fetch-cors/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dotnetCarpenter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-04-03T17:07:42.000Z","updated_at":"2022-04-03T17:16:35.000Z","dependencies_parsed_at":"2023-06-30T04:00:59.482Z","dependency_job_id":null,"html_url":"https://github.com/dotnetCarpenter/bug-firefox-fetch-cors","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dotnetCarpenter/bug-firefox-fetch-cors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnetCarpenter%2Fbug-firefox-fetch-cors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnetCarpenter%2Fbug-firefox-fetch-cors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnetCarpenter%2Fbug-firefox-fetch-cors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnetCarpenter%2Fbug-firefox-fetch-cors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotnetCarpenter","download_url":"https://codeload.github.com/dotnetCarpenter/bug-firefox-fetch-cors/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnetCarpenter%2Fbug-firefox-fetch-cors/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28910971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T08:15:08.179Z","status":"ssl_error","status_checked_at":"2026-01-30T08:14:31.507Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bugreport","firefox-browser"],"created_at":"2024-10-10T14:36:16.387Z","updated_at":"2026-01-30T10:06:12.671Z","avatar_url":"https://github.com/dotnetCarpenter.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Firefox Fetch CORS with range header bug\n\nFirefox bugzilla report: https://bugzilla.mozilla.org/show_bug.cgi?id=1762794\n\n- [Steps to reproduce:](#steps-to-reproduce)\n- [Actual results:](#actual-results)\n- [Expected results:](#expected-results)\n\n_**Below is the submitted bug report:**_\n\n## Steps to reproduce:\n\nI think I found a bug in the Fetch implementation in Firefox where the range header is not recognized as a CORS-safelisted request-header.\n\nAccording to https://fetch.spec.whatwg.org/#cors-safelisted-request-header, `range` is considered a CORS-safelisted request-header if it is a simple range header value (https://fetch.spec.whatwg.org/#simple-range-header-value). E.g. `bytes=0-127` is a simple range header value.\n\n\u003e The relevant failing test-case on Web Platform Tests (wpt) is here: https://wpt.fyi/results/cors/cors-safelisted-request-header.any.html?label=experimental\u0026label=master\u0026aligned\n\u003e\n\u003e Source:\n\u003e + http://wpt.live/cors/cors-safelisted-request-header.any.js\n\u003e + https://github.com/web-platform-tests/wpt/blob/902e9dceb10d98a646ad77d46df62e0365626fff/cors/cors-safelisted-request-header.any.js\n\nI have created a reduced test-case at https://dotnetcarpenter.github.io/bug-firefox-fetch-cors/.\n\n1. Press the \"Fetch\" button and see the result under the \"Result\" label.\n2. Use DevTools to see the error, \"CORS Preflight Did Not Succeed\".\n\nSource code is at https://github.com/dotnetCarpenter/bug-firefox-fetch-cors.\n\n```js\nconst url = 'https://raw.githubusercontent.com/OpenXcom/OpenXcom/94640aab1279ae268e0420a7b5c99cc44eb09473/bin/common/SoldierName/Danish.nam';\n\nconst appHtml     = document.querySelector ('#app');\nconst fetchButton = appHtml.querySelector ('#fetch');\nconst resultPre   = appHtml.querySelector ('#result');\n\nfetchButton.addEventListener ('click', () =\u003e {\n  fetch (url, {\n    headers: {\n      range: 'bytes=0-127'\n    }\n  }).then (response =\u003e {\n      response.text ()\n        .then (text =\u003e {\n          resultPre.textContent = text;\n        });\n    })\n    .catch (error =\u003e {\n      resultPre.textContent = `Error: ${error.message}`;\n    });\n});\n```\n\n\n## Actual results:\n\n1. Go to https://dotnetcarpenter.github.io/bug-firefox-fetch-cors/\n2. Clicking the button will fetch the first 128 bytes from raw.githubusercontent.com/OpenXcom/OpenXcom/bin/common/SoldierName/Danish.nam, or in the case of Firefox 99.0b8 (64-bit), throw an error.\n\n\n## Expected results:\n\nIn Chrome, you will get the following result (content of the \u0026lt;pre\u0026gt; element):\n\n```\nlookWeights:\n  - 49\n  - 49\n  - 2\n  - 0\nmaleFirst:\n  - Absalon\n  - Adam\n  - Adolf\n  - Albert\n  - Alex\n  - Alexander\n  - Alf\n  - A\n```\n_☝️ The first 128 bytes of https://raw.githubusercontent.com/OpenXcom/OpenXcom/94640aab1279ae268e0420a7b5c99cc44eb09473/bin/common/SoldierName/Danish.nam_","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotnetcarpenter%2Fbug-firefox-fetch-cors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotnetcarpenter%2Fbug-firefox-fetch-cors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotnetcarpenter%2Fbug-firefox-fetch-cors/lists"}