Open d4rekanguok opened 4 years ago
So this is called 'protocol relative url', which now has been declared an anti-pattern source.
The gatsby contentful remark image plugin does this:
...and I need this use case now, so let's just copy this over... and remove it when contenful stops sending these urls.
Actually, let user add the whitelist in their config. We don't need to store a list internally like this
Hi, I've checked that this plugin hard codes the whitelisted domains a certain domain, ['images.ctfassets.net']
in src/relative-protocol-whitelist.ts
.
While #14 helps with Contentful, there's still no way for users to specify whitelisted domain.
My idea in implementing is to add relativeImageProtocol
key into plugin configuration and have this merged into predefined whitelist.
Let me know if I should help & open PR for this, if work on this has not been started.
Hi @benedictjohannes, thank you for your interests in this plugin! I would gladly take a PR that address this.
Apparently contentful inline asset url is just
//images.cdn...
instead ofhttps://...
, so the url fell thru. Kinda weird.Gatsby provides an official plugin to handle images in contentful, but it's still handy to make this plugin work with those assets as well.