404

[ Avaa Bypassed ]




Upload:

Command:

botdev@3.149.253.148: ~ $
/**
 * Module dependencies.
 */

var getUri = require('../');
var assert = require('assert');
var streamToArray = require('stream-to-array');

describe('get-uri', function () {

  describe('"data:" protocol', function () {

    var cache;

    it('should work for URL-encoded data', function (done) {
      getUri('data:,Hello%2C%20World!', function (err, rs) {
        if (err) return done(err);
        cache = rs;
        streamToArray(rs, function (err, array) {
          if (err) return done(err);
          var buf = Buffer.concat(array);
          assert.equal('Hello, World!', buf.toString());
          done();
        });
      });
    });

    it('should work for base64-encoded data', function (done) {
      getUri('data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D', function (err, rs) {
        if (err) return done(err);
        streamToArray(rs, function (err, array) {
          if (err) return done(err);
          var buf = Buffer.concat(array);
          assert.equal('Hello, World!', buf.toString());
          done();
        });
      });
    });

    it('should return ENOTMODIFIED for the same URI with `cache`', function (done) {
      getUri('data:,Hello%2C%20World!', { cache: cache }, function (err, rs) {
        assert(err);
        assert.equal('ENOTMODIFIED', err.code);
        done();
      });
    });

  });

});

Filemanager

Name Type Size Permission Actions
data.js File 1.32 KB 0644
file.js File 1.7 KB 0644
ftp.js File 2.38 KB 0644
http.js File 1.86 KB 0644
https.js File 2.1 KB 0644
redirect.js File 2.86 KB 0644
server.crt File 757 B 0644
server.key File 891 B 0644
test.js File 533 B 0644