Skip to content

Commit 6edd292

Browse files
committed
proxy path is actually the same regardless of version
1 parent 18241fe commit 6edd292

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

middleware/archived-enterprise-versions-assets.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
const path = require('path')
2-
const versionSatisfiesRange = require('../lib/version-satisfies-range')
32
const patterns = require('../lib/patterns')
4-
const firstVersionDeprecatedOnNewSite = '2.13'
53
const got = require('got')
64

75
// This module handles requests for the CSS and JS assets for
@@ -17,18 +15,8 @@ module.exports = async (req, res, next) => {
1715
// Only match asset paths
1816
if (!patterns.assetPaths.test(req.path)) return next()
1917

20-
// get /dist/index.js and /dist/index.css paths from enterprisified paths
2118
const assetPath = req.path.replace(`/enterprise/${requestedVersion}`, '')
22-
23-
// paths are slightly different depending on the enterprise version
24-
let proxyPath
25-
if (versionSatisfiesRange(requestedVersion, `>=${firstVersionDeprecatedOnNewSite}`)) {
26-
// routing for >=2.13
27-
proxyPath = path.join('/', requestedVersion, assetPath)
28-
} else if (versionSatisfiesRange(requestedVersion, `<${firstVersionDeprecatedOnNewSite}`)) {
29-
// routing for <2.13
30-
proxyPath = path.join('/', requestedVersion, 'assets', assetPath)
31-
}
19+
const proxyPath = path.join('/', requestedVersion, assetPath)
3220

3321
try {
3422
const r = await got(`https://github.github.com/help-docs-archived-enterprise-versions${proxyPath}`)

0 commit comments

Comments
 (0)