Skip to content

Commit

Permalink
always serve text/plain
Browse files Browse the repository at this point in the history
  • Loading branch information
motdotla committed Jun 14, 2024
1 parent f52eaf3 commit d685e57
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,8 @@ fs.readFile(installerScriptPath, 'utf8', (err, data) => {
})

app.get('/', (req, res) => {
// Check User-Agent to determine the response
const userAgent = req.headers['user-agent'] || ''
if (userAgent.includes('curl') || userAgent.includes('wget')) {
res.type('text/plain')
res.send(installerScript)
} else {
res.redirect('https://dotenvx.com')
}
res.type('text/plain')
res.send(installerScript)
})

app.get('/:os/:arch', async (req, res) => {
Expand Down

0 comments on commit d685e57

Please sign in to comment.