Skip to content

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

Open
@rvanlaak

Description

@rvanlaak

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions