Will be blocked in a https context by the browser.
It gets a 303, See other and the location will be http.
I think this might be a bug in the code base of DBpedia.
Thanks for the advise,
I would rather file this as a bug of the DBpedia infrastructure, but I do not know where to do that.
It does a redirect from https to http, that is not allowed in the browser when using https.
A little bit of background: I am creating a form system that uses the /resource/* url to show when a person goes there it is redirected to a human readable page and when I fetch it with a jsonld header, I get jsonld.
Also, I am not sure about the redirect from https to http that you are talking about as there is no such redirect to http happening on my end. In the code, as you can see, although the URL entered is resource, it fetches from the page URL.
Did you spin up your own server that used https?
It should happen in the context of a valid https website.
You can even do it in this page. You can open up the console and use the javascript from your snippet.
The fetch method follows redirects automatically. So you would not notice untill there is an error.
This is true though, I tried it. I believe you are working on a local dev server or something else? If you are working on a local dev server it should work fine.