Skip to content

Commit

Permalink
fix deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners committed Jul 12, 2024
1 parent 1100923 commit ae2faca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ async function fastifyStatic (fastify, opts) {
})
if (opts.redirect === true && prefix !== opts.prefix) {
fastify.get(opts.prefix, routeOpts, (req, reply) => {
reply.redirect(301, getRedirectUrl(req.raw.url))
reply.redirect(getRedirectUrl(req.raw.url), 301)
})
}
} else {
Expand Down Expand Up @@ -244,7 +244,7 @@ async function fastifyStatic (fastify, opts) {

if (opts.redirect === true) {
try {
reply.redirect(301, getRedirectUrl(request.raw.url))
reply.redirect(getRedirectUrl(request.raw.url), 301)
} /* c8 ignore start */ catch (error) {
// the try-catch here is actually unreachable, but we keep it for safety and prevent DoS attack
await reply.send(error)

Check warning

Code scanning / CodeQL

Information exposure through a stack trace Medium

This information exposed to the user depends on
stack trace information
.
Expand Down

0 comments on commit ae2faca

Please sign in to comment.