impress/app
Emi Matchu 38bad12778 Fix item animations for asset URLs that contain unescaped spaces
Before this change, the "Ornamental Lake with Goldies" item would fail
to preview on the item page: the iframe for the animation layer would
display an error page.

The error was:

```
Invalid Content Security Policy script-src: "https://images.neopets.com/cp/items/data/000/000/497/497366_deca9f2827/497366_HTML5 Canvas.js". Directive values must not contain whitespace or semicolons. Please use multiple arguments or other directive methods instead. (ActionDispatch::ContentSecurityPolicy::InvalidDirectiveError)
```

This is because the URL that Neopets sends us for this JS file contains
an unescaped space character. This isn't usually an issue for e.g.
loading a URL in the browser, but it's *not* valid syntax for inclusion
in a Content Security Policy.

In this change, we update our CSP code to parse URLs into
`Addressable::URI` objects, which enables us to call the `normalize!`
method, which fixes oddities like that.

The URL now correctly appears in the CSP as
`https://images.neopets.com/cp/items/data/000/000/497/497366_deca9f2827/497366_HTML5%20Canvas.js`.
2025-03-29 14:45:41 -07:00
..
assets Add Support form for users, with shadowban option 2025-02-16 09:32:52 -08:00
controllers Fix item animations for asset URLs that contain unescaped spaces 2025-03-29 14:45:41 -07:00
helpers Update pet state bulk-labeling to skip to next unlabeled if desired 2024-12-08 10:08:39 -08:00
javascript Add configurable full name field to alt styles 2025-02-15 21:52:47 -08:00
mailers/fundraising Move most fundraising files into a Fundraising module 2024-02-18 20:12:14 -08:00
models Add configurable full name field to alt styles 2025-02-15 21:52:47 -08:00
services Add workarounds for new Neopets.com security rules 2025-03-29 14:14:46 -07:00
views Add Support form for users, with shadowban option 2025-02-16 09:32:52 -08:00