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

FilterUrl event not raised for relative URLs if baseUrl is used #542

Closed
vanni-giachin opened this issue Apr 16, 2024 · 1 comment
Closed

Comments

@vanni-giachin
Copy link

According to the documentation the FilterUrl event should be raised every time a URL is sanitized:

Occurs when a URL is being sanitized

However if the URL to sanitize is relative, and a baseUrl is used as sanitization parameter, the URL filters are not invoked.

See code line: https://github.com/mganss/HtmlSanitizer/blob/v8.0.843/src/HtmlSanitizer/HtmlSanitizer.cs#L856

There is a return statement before OnFilteringUrl is invoked: return new Uri(baseUri, iri.Value).AbsoluteUri;

@mganss
Copy link
Owner

mganss commented Apr 16, 2024

Great catch, thank you!

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

No branches or pull requests

2 participants