Skip to content

Commit

Permalink
fixup! linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lew Gordon committed Jul 15, 2021
1 parent beee6a4 commit 151a63e
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions test/parallel/test-http-decoded-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,32 @@ const assert = require('assert');
const http = require('http');

const testCases = [
{username: 'test@test"', password: '123456^', expected: 'dGVzdEB0ZXN0IjoxMjM0NTZe'},
{username: 'test%40test', password: '123456', expected: 'dGVzdEB0ZXN0OjEyMzQ1Ng=='},
{username: 'not%3Agood', password: 'god', expected: 'bm90Omdvb2Q6Z29k'},
{username: 'not%22good', password: 'g%5Eod', expected: 'bm90Imdvb2Q6Z15vZA=='},
{username: 'test1234::::', password: 'mypass', expected: 'dGVzdDEyMzQ6Ojo6Om15cGFzcw=='}
]
{
username: 'test@test"',
password: '123456^',
expected: 'dGVzdEB0ZXN0IjoxMjM0NTZe'
},
{
username: 'test%40test',
password: '123456',
expected: 'dGVzdEB0ZXN0OjEyMzQ1Ng=='
},
{
username: 'not%3Agood',
password: 'god',
expected: 'bm90Omdvb2Q6Z29k'
},
{
username: 'not%22good',
password: 'g%5Eod',
expected: 'bm90Imdvb2Q6Z15vZA=='
},
{
username: 'test1234::::',
password: 'mypass',
expected: 'dGVzdDEyMzQ6Ojo6Om15cGFzcw=='
},
];

for (const testCase of testCases) {
const server = http.createServer(function(request, response) {
Expand All @@ -19,7 +39,7 @@ for (const testCase of testCases) {
response.end('ok');
server.close();
});

server.listen(0, function() {
// make the request
const url = new URL(`http://${testCase.username}:${testCase.password}@localhost:${this.address().port}`);
Expand Down

0 comments on commit 151a63e

Please sign in to comment.