green-metrics-tool icon indicating copy to clipboard operation
green-metrics-tool copied to clipboard

HTML escaping inefficient and inconsistent

Open ArneTR opened this issue 2 months ago • 0 comments

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 avatar May 12 '24 10:05 ArneTR