Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
test: update HTTP basic auth test
Verify that URL-encoded entities are properly encoded into the Authorization
header.
  • Loading branch information
bnoordhuis committed Feb 20, 2012
1 parent 86f4846 commit f116e17
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/simple/test-http-url.parse-auth.js
Expand Up @@ -24,11 +24,12 @@ var assert = require('assert');
var http = require('http');
var url = require('url');

var testURL = url.parse('http://asdf:qwer@localhost:' + common.PORT);
// username = "user", password = "pass:"
var testURL = url.parse('http://user:pass%3A@localhost:' + common.PORT);

function check(request) {
// the correct authorization header is be passed
assert.strictEqual(request.headers.authorization, 'Basic YXNkZjpxd2Vy');
assert.strictEqual(request.headers.authorization, 'Basic dXNlcjpwYXNzOg==');
}

var server = http.createServer(function(request, response) {
Expand Down

0 comments on commit f116e17

Please sign in to comment.