Enabling HSTS does crash the Admin as it fetches docs over http
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Start at parseHydraDocumentation.ts, which the report identifies as the production entry point, and compare its docs.jsonld URL handling with the docs.jsonld header in api/frankenphp/Caddyfile. Trace where the protocol is selected and verify that the Admin can fetch the documentation under HTTPS with HSTS enabled without the mixed-protocol crash.
Written by the indexing model from the issue text.
Description
API Platform version(s) affected: 4.1.0
Description
On Cloudflare we enabled HSTS to have strict https everywhere. The React Admin does fetch the docs.jsonld from http though. This results in a mixed-protocol exception.
How to reproduce
Only the Caddyfile seems to point to docs.jsonld by including that as header. The file is untouched since we started the project:
https://github.com/api-platform/api-platform/blob/main/api/frankenphp/Caddyfile#L42
Possible Solution
Not sure where the fetch gets initiated, but maybe not include the protocol so that gets determined by the initiator?
- http://foo.bar.com/docs.jsonld
+ //foo.bar.com/docs.jsonld
Does the docs url gets parsed client side or server side (read: next / node)?
Additional Context
- On localhost we have https as well, but cannot reproduce this as the docs.jsonld is properly fetched over https over there.
- On
productionI can narrow it down to the parseHydraDocumentation.ts file
- Dominant language
- TypeScript
- Stars
- 516
- Forks
- 134
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from api-platform/admin
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
api-platform/admin#616 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 64/100
api-platform/admin#660 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 50/100
api-platform/admin#659 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
api-platform/admin#626 · 1 comment · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
api-platform/admin#615 · 4 comments · 2 reactions ·
All issues in api-platform/admin
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug v2
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
modelcontextprotocol/inspector#2458 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
carbon-design-system/ibm-products#9907 ·