Files
mattermost/server
Alejandro García Montoro d81ce03168 MM-57839: Rewrite static assets only if needed (#27076)
* Rewrite static assets only if needed

Refactor UpdateAssetsSubpathInDir so that the actual rewriting of files
happen in two different functions: one for root.html, another for
manifest.json and *.css files.

I would have wanted to simply do a

  if pathToReplace == newPath { return nil }

when those two variables are defined, but the logic for root.html is not
that simple, and that may miss some edge cases, so I opted out for
simply moving the actual rewriting to individual functions, which check
for their corresponding conditions to perform the update:
  1. for root.html, check that the edited file is indeed different than
     the original one
  2. for manifest.json and *.css files, rewrite them only if
     pathToReplace != newPath, which in this case is clear that that's the
     only modification we do

* Fix expected error msg in test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-06-13 12:01:57 +02:00
..
2023-03-22 17:22:27 -04:00
2024-06-12 11:33:04 +02:00
2024-06-12 11:33:04 +02:00
2023-03-22 17:22:27 -04:00
2023-03-22 17:22:27 -04:00
2024-01-08 10:47:24 -04:00
2023-03-22 17:22:27 -04:00
2023-03-22 17:22:27 -04:00
2024-05-15 12:05:13 -03:00