Skip to content

Commit

Permalink
Changed from noFollowRedirects to ignoreRedirects
Browse files Browse the repository at this point in the history
  • Loading branch information
mbogh committed Feb 25, 2021
1 parent 1a112dc commit 8b7f2ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions services/security-headers/security-headers.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { BaseService, NotFound } = require('..')

const queryParamSchema = Joi.object({
url: optionalUrl.required(),
noFollowRedirects: Joi.equal(''),
ignoreRedirects: Joi.equal(''),
}).required()

const documentation = `
Expand Down Expand Up @@ -42,7 +42,7 @@ module.exports = class SecurityHeaders extends BaseService {
{
title: "Security Headers (Don't follow redirects)",
namedParams: {},
queryParams: { url: 'https://www.shields.io', noFollowRedirects: null },
queryParams: { url: 'https://www.shields.io', ignoreRedirects: null },
staticPreview: this.render({
grade: 'R',
}),
Expand Down Expand Up @@ -72,15 +72,15 @@ module.exports = class SecurityHeaders extends BaseService {
}
}

async handle(namedParams, { url, noFollowRedirects }) {
async handle(namedParams, { url, ignoreRedirects }) {
const { res } = await this._request({
url: `https://securityheaders.com`,
options: {
method: 'HEAD',
qs: {
q: url,
hide: 'on',
followRedirects: noFollowRedirects !== undefined ? null : 'on',
followRedirects: ignoreRedirects !== undefined ? null : 'on',
},
},
})
Expand Down
2 changes: 1 addition & 1 deletion services/security-headers/security-headers.tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ t.create('grade of https://shields.io')
.expectBadge({ label: 'security headers', message: 'F', color: 'red' })

t.create('grade of https://httpstat.us/301 as redirect')
.get('/security-headers.json?noFollowRedirects&url=https://httpstat.us/301')
.get('/security-headers.json?ignoreRedirects&url=https://httpstat.us/301')
.expectBadge({ label: 'security headers', message: 'R', color: 'lightgrey' })

0 comments on commit 8b7f2ae

Please sign in to comment.