Dress to Impress, a big fancy Neopets customization tool!
Find a file
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
.devcontainer Save last trade activity time onto User 2024-01-19 00:00:46 -08:00
.husky Add RSpec to the commit hook 2024-10-24 15:22:39 -07:00
app Fix item animations for asset URLs that contain unescaped spaces 2025-03-29 14:45:41 -07:00
bin Run rails app:update to update config files 2025-01-12 12:36:18 -08:00
config Add workarounds for new Neopets.com security rules 2025-03-29 14:14:46 -07:00
db Add configurable full name field to alt styles 2025-02-15 21:52:47 -08:00
deploy Upgrade to Ruby 3.3.7 2025-03-29 13:12:35 -07:00
lib Add workarounds for new Neopets.com security rules 2025-03-29 14:14:46 -07:00
public
spec Add configurable full name field to alt styles 2025-02-15 21:52:47 -08:00
test
vendor Upgrade to Ruby 3.3.7 2025-03-29 13:12:35 -07:00
.eslintrc.json Set up eslint for wardrobe-2020 2023-11-02 18:11:07 -07:00
.gitignore
.rspec
.ruby-version Upgrade to Ruby 3.3.7 2025-03-29 13:12:35 -07:00
.solargraph.yml
.yarnrc.yml
config.ru Upgrade to Rails 6.1.7.4 2023-10-23 19:05:07 -07:00
falcon.rb
Gemfile Upgrade to Ruby 3.3.7 2025-03-29 13:12:35 -07:00
Gemfile.lock Upgrade to Ruby 3.3.7 2025-03-29 13:12:35 -07:00
LICENSE.md
package.json
Procfile.dev Use local-only HTTPS certs for the development neopass-server 2024-03-14 18:01:54 -07:00
Rakefile
README.md Oops, needs to be a README.md file! 2023-10-25 16:31:41 -07:00
yarn.lock Upgrade typescript-eslint dependencies 2024-05-06 15:08:37 -07:00

Dress to Impress beach logo

Dress to Impress

Oh! We've been revitalizing the Rails app! Fun!

There'll be more to say about it here soon :3