Files
hnh-map/frontend-nuxt/server/middleware/0.uri-guard.ts
Nikolay Tatarinov 605a31567e Add initial project structure with backend and frontend setup
- Created backend structure with Go, including main application logic and API endpoints.
- Added Docker support for both development and production environments.
- Introduced frontend using Nuxt 3 with Tailwind CSS for styling.
- Included configuration files for Docker and environment variables.
- Established basic documentation for contributing, development, and deployment processes.
- Set up .gitignore and .dockerignore files to manage ignored files in the repository.
2026-02-24 22:27:05 +03:00

13 lines
416 B
TypeScript

/**
* Reject requests with malformed URI before they reach Vite.
* Vite's static middleware calls decodeURI() and throws "URI malformed" on invalid sequences (e.g. %2: or %91).
*/
export default defineEventHandler((event) => {
const path = event.path ?? event.node.req.url ?? ''
try {
decodeURI(path)
} catch {
throw createError({ statusCode: 400, statusMessage: 'Bad Request' })
}
})