test: update HTTP basic auth test
Verify that URL-encoded entities are properly encoded into the Authorization header.
This commit is contained in:
parent
86f4846c21
commit
f116e17a23
@ -24,11 +24,12 @@ var assert = require('assert');
|
|||||||
var http = require('http');
|
var http = require('http');
|
||||||
var url = require('url');
|
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) {
|
function check(request) {
|
||||||
// the correct authorization header is be passed
|
// 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) {
|
var server = http.createServer(function(request, response) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user