Skip to content

Commit

Permalink
removed integrity property
Browse files Browse the repository at this point in the history
  • Loading branch information
netptop committed Feb 26, 2020
1 parent f793346 commit 5517f7a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const regReplaceMap = {
'http://([-a-z0-9A-Z.]+)': `${httpprefix}://${serverName}:${port}/http/$1`,
'https%3a%2f%2f([-a-z0-9A-Z]+?)': `${httpprefix}%3a%2f%2f${serverName}%3a${port}%2fhttps%2f$1`,
'http%3a%2f%2f([-a-z0-9A-Z]+?)': `${httpprefix}%3a%2f%2f${serverName}%3a${port}%2fhttp%2f$1`,
' integrity=".+?"': '', // remove integrity
}

const pathReplace = ({host, httpType, body}) => {
Expand Down
16 changes: 15 additions & 1 deletion test/siteproxylocal.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ test('worldjournal.com redirect location', async () => {
validateStatus: null, // important for status 302
url,
})
console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${JSON.stringify(response.headers)}`)
expect(response.headers['location'].indexOf(`/https/www.worldjournal.com`)).not.toBe(-1)
}, 30000);

test('remove integrity', async () => {
const url = `${httpprefix}://${serverName}:${port}/https/github.com`
const response = await axios({
method: 'get',
headers: {
'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`,
},
url,
})
// console.log(`${JSON.stringify(response.headers)}`)
// console.log(`${response.data}`)
expect(response.data.indexOf(` integrity="`)).toBe(-1)
}, 30000);

0 comments on commit 5517f7a

Please sign in to comment.