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

HTML escaping inefficient and inconsistent #768

Open
ArneTR opened this issue May 12, 2024 · 0 comments
Open

HTML escaping inefficient and inconsistent #768

ArneTR opened this issue May 12, 2024 · 0 comments
Labels
front end good first issue Good for newcomers help wanted Extra attention is needed

Comments

@ArneTR
Copy link
Member

ArneTR commented May 12, 2024

Currently GMT applies HTML escapes at different stages of the code

  • When ingesting data
  • When outputting data from the API
  • In the JS frontend

The two former calls are all funneled through html_escape_multi in the main.py and api_helpers.py.

The latter is done in native JS code through the function escapeString.

In JS land it often occurs that we have arguments that need to be checked on every call. For instance when we ingest URL params.

However in the API / backend side it is unneded to do the escaping on every call. It should be streamlined to only happen on ingest or at least the transformed output should be cached indefinitely if a clean DB is preferred.

@ArneTR ArneTR added good first issue Good for newcomers help wanted Extra attention is needed front end labels May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
front end good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant