mirror of
https://github.com/arnaucube/raspberryGPIOhtmlserver.git
synced 2026-02-08 12:16:42 +01:00
servidor funciona, gpio desabilitat
This commit is contained in:
64
node_modules/cookie/test/serialize.js
generated
vendored
Executable file
64
node_modules/cookie/test/serialize.js
generated
vendored
Executable file
@@ -0,0 +1,64 @@
|
||||
// builtin
|
||||
var assert = require('assert');
|
||||
|
||||
var cookie = require('..');
|
||||
|
||||
suite('serialize');
|
||||
|
||||
test('basic', function() {
|
||||
assert.equal('foo=bar', cookie.serialize('foo', 'bar'));
|
||||
assert.equal('foo=bar%20baz', cookie.serialize('foo', 'bar baz'));
|
||||
});
|
||||
|
||||
test('path', function() {
|
||||
assert.equal('foo=bar; Path=/', cookie.serialize('foo', 'bar', {
|
||||
path: '/'
|
||||
}));
|
||||
});
|
||||
|
||||
test('secure', function() {
|
||||
assert.equal('foo=bar; Secure', cookie.serialize('foo', 'bar', {
|
||||
secure: true
|
||||
}));
|
||||
|
||||
assert.equal('foo=bar', cookie.serialize('foo', 'bar', {
|
||||
secure: false
|
||||
}));
|
||||
});
|
||||
|
||||
test('domain', function() {
|
||||
assert.equal('foo=bar; Domain=example.com', cookie.serialize('foo', 'bar', {
|
||||
domain: 'example.com'
|
||||
}));
|
||||
});
|
||||
|
||||
test('httpOnly', function() {
|
||||
assert.equal('foo=bar; HttpOnly', cookie.serialize('foo', 'bar', {
|
||||
httpOnly: true
|
||||
}));
|
||||
});
|
||||
|
||||
test('maxAge', function() {
|
||||
assert.equal('foo=bar; Max-Age=1000', cookie.serialize('foo', 'bar', {
|
||||
maxAge: 1000
|
||||
}));
|
||||
});
|
||||
|
||||
test('escaping', function() {
|
||||
assert.deepEqual('cat=%2B%20', cookie.serialize('cat', '+ '));
|
||||
});
|
||||
|
||||
test('parse->serialize', function() {
|
||||
|
||||
assert.deepEqual({ cat: 'foo=123&name=baz five' }, cookie.parse(
|
||||
cookie.serialize('cat', 'foo=123&name=baz five')));
|
||||
|
||||
assert.deepEqual({ cat: ' ";/' }, cookie.parse(
|
||||
cookie.serialize('cat', ' ";/')));
|
||||
});
|
||||
|
||||
test('unencoded', function() {
|
||||
assert.deepEqual('cat=+ ', cookie.serialize('cat', '+ ', {
|
||||
encode: function(value) { return value; }
|
||||
}));
|
||||
})
|
||||
Reference in New Issue
Block a user