Skip to content

Commit

Permalink
need to parse the JSON first
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahs committed Feb 24, 2021
1 parent ecc5d01 commit f1336fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion middleware/archived-enterprise-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ module.exports = async (req, res, next) => {
let isRedirect = false
if (versionSatisfiesRange(requestedVersion, `>${lastVersionWithoutArchivedRedirectsFile}`)) {
try {
const redirectJson = await got(getProxyPath('redirects.json', requestedVersion))
const res = await got(getProxyPath('redirects.json', requestedVersion))
const redirectJson = JSON.parse(res.body)

if (redirectJson[req.path]) {
isRedirect = true
Expand Down

0 comments on commit f1336fd

Please sign in to comment.