Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Enabling HSTS does crash the Admin as it fetches docs over http

Open
#631 6 comments 0 reactions 0 assignees View on GitHub

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 production I can narrow it down to the parseHydraDocumentation.ts file
Image
Dominant language
TypeScript
Stars
516
Forks
134
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from api-platform/admin

All issues in api-platform/admin

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.