fastify-swagger-ui
fastify-swagger-ui copied to clipboard
fix: static content for routePrefix with subpath (#165)
This fixes https://github.com/fastify/fastify-swagger-ui/issues/165, where having a subpath in routePrefix
breaks static content loading due to changes in https://github.com/fastify/fastify-swagger-ui/pull/164.
Now the static content urls are relative only with a trailing slash, otherwise they're absolute - meaning they work the same as before the regression.
The tests for this were already developed but with wrong assertions, to be able to test static content is loaded I assume we'd need to run playwright with different prefix variations, which would require a refactor as all playwright tests are run with /documentation
as the prefix.
Please let me know if you have any suggestions regarding the tests.
Checklist
- [x] run
npm run test
andnpm run benchmark
- [x] tests and/or benchmarks are included
- [ ] documentation is changed or added
- [x] commit message and code follows the Developer's Certification of Origin and the Code of conduct