flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
25
BACK_BACK/node_modules/stream-http/test/browser/cookie.js
generated
vendored
Executable file
25
BACK_BACK/node_modules/stream-http/test/browser/cookie.js
generated
vendored
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
var Buffer = require('buffer').Buffer
|
||||
var test = require('tape')
|
||||
|
||||
var http = require('../..')
|
||||
|
||||
test('cookie', function (t) {
|
||||
var cookie = 'hello=world'
|
||||
window.document.cookie = cookie
|
||||
|
||||
http.get({
|
||||
path: '/cookie',
|
||||
withCredentials: false
|
||||
}, function (res) {
|
||||
var buffers = []
|
||||
|
||||
res.on('end', function () {
|
||||
t.ok(new Buffer(cookie).equals(Buffer.concat(buffers)), 'hello cookie echoed')
|
||||
t.end()
|
||||
})
|
||||
|
||||
res.on('data', function (data) {
|
||||
buffers.push(data)
|
||||
})
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue