Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an exception for xmlns usage, and add appropriate testing #11

Merged
merged 2 commits into from
May 11, 2021

Conversation

HarryGwinnell
Copy link

@HarryGwinnell HarryGwinnell commented Apr 29, 2021

This PR addresses issue #10 to allow any namespace to be used in an xmlns attribute. Unfortunately most XML namespaces use http:// as prefixes, even though these urls are never resolved (and are often not valid addresses anyway).

As this issue only presents in React implementations, I've added a new parserOptions to simulate a typescript/react setup (mirroring our use case). This included adding a tsconfig with jsx enabled, and a blank estree.tsx.

I've added a sample valid & invalid test case using SVGs, but this should hold true for any XML that is used.

@HarryGwinnell
Copy link
Author

I can't assign this, but pinging @A-Katopodis for code review

@A-Katopodis A-Katopodis self-requested a review May 11, 2021 00:10
@A-Katopodis
Copy link
Contributor

Hi @HarryGwinnell,

Thanks for the contribution! Left one comment but everything else looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

http://localhost should be allowed by @microsoft/sdl/no-insecure-url
2 participants