a zip code crypto-currency system good for red ONLY

cookie.js 510B

1234567891011121314151617181920212223242526
  1. var Buffer = require('buffer').Buffer
  2. var test = require('tape')
  3. var http = require('../..')
  4. test('cookie', function (t) {
  5. var cookie = 'hello=world'
  6. window.document.cookie = cookie
  7. http.get({
  8. path: '/cookie',
  9. withCredentials: false
  10. }, function (res) {
  11. var buffers = []
  12. res.on('end', function () {
  13. t.ok(new Buffer(cookie).equals(Buffer.concat(buffers)), 'hello cookie echoed')
  14. t.end()
  15. })
  16. res.on('data', function (data) {
  17. buffers.push(data)
  18. })
  19. })
  20. })