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

Fix urlize for pulp api hrefs #5665

Merged
merged 1 commit into from
Aug 5, 2024
Merged

Fix urlize for pulp api hrefs #5665

merged 1 commit into from
Aug 5, 2024

Conversation

mdellweg
Copy link
Member

@mdellweg mdellweg commented Aug 2, 2024

Instead of carrying a copy of the whole api template, we just overwrite the branding related blocks. Also we monkeypatch django's urlize to know about pulp api hrefs.

fixes #5664

Instead of carrying a copy of the whole api template, we just overwrite
the branding related blocks. Also we monkeypatch django's urlize to know
about pulp api hrefs.

fixes pulp#5664
@mdellweg mdellweg marked this pull request as ready for review August 4, 2024 10:42
@mdellweg mdellweg enabled auto-merge (rebase) August 4, 2024 17:16
Copy link
Contributor

@ggainey ggainey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a BIG fan of relying on the existing library as much as we can, and only overriding for our specific need. Some basic smoke-testing shows the API pages work well with this change, and atempting some XSS-injection fails, so looks good to me.

@mdellweg mdellweg merged commit 734e471 into pulp:main Aug 5, 2024
11 checks passed
@mdellweg mdellweg deleted the api_templates branch August 5, 2024 16:04
Copy link

patchback bot commented Aug 27, 2024

Backport to 3.49: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.49/734e47167159cd8cd71442ea82fe14f4bfd29c2f/pr-5665

Backported as #5736

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

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

Successfully merging this pull request may close these issues.

urlize_quoted_hrefs() still broken on v3 API browser
3 participants