Skip to content

Commit 98cbffa

Browse files
committed
Use explicit status codes
1 parent b6f9176 commit 98cbffa

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

server/middleware/packageURL.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,21 @@ function packageURL(req, res, next) {
4949
// Redirect /_meta/path to /path?meta.
5050
if (req.path.match(/^\/_meta\//)) {
5151
req.query.meta = ''
52-
return res.redirect(req.path.substr(6) + createSearch(req.query))
52+
return res.redirect(302, req.path.substr(6) + createSearch(req.query))
5353
}
5454

5555
// Redirect /path?json => /path?meta
5656
if (req.query.json != null) {
5757
delete req.query.json
5858
req.query.meta = ''
59-
return res.redirect(req.path + createSearch(req.query))
59+
return res.redirect(302, req.path + createSearch(req.query))
6060
}
6161

6262
// Redirect requests with unknown query params to their equivalents
6363
// with only known params so they can be served from the cache. This
6464
// prevents people using random query params designed to bust the cache.
6565
if (!queryIsKnown(req.query))
66-
return res.redirect(req.path + createSearch(sanitizeQuery(req.query)))
66+
return res.redirect(302, req.path + createSearch(sanitizeQuery(req.query)))
6767

6868
const url = parsePackageURL(req.url)
6969

0 commit comments

Comments
 (0)