Adding headers to the src URL.
ostwalprasad opened this issue · comments
I'm fetching SVG from a URL that needs an authentication header. I see that the URL is directly passed to src
. Is there any way to fetch SVG first using fetch
and then provide that to ReactSVG?
Hi @ostwalprasad.
This library relies on tanem/svg-injector, which uses XMLHttpRequest
to fetch SVGs. That library has an httpRequestWithCredentials
option, which controls the withCredentials
setting.
I think that's what you'll be after, but it's currently not being passed through from this library. I'll make a change that allows that, and will update this issue once a PR is ready.
Released the change in v14.1.0
if you want to try it out 🍀
thanks a lot for the change, @tanem. I'll try it out! 😄