0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 23:43:09 +01:00
nodejs/doc
James M Snell 6192c9892f http: add checkIsHttpToken check for header fields
Ref: https://github.com/nodejs/node-convergence-archive/issues/13

This adds a new check for header and trailer fields names and method
names to ensure that they conform to the HTTP token rule. If they do
not, a `TypeError` is thrown.

Previously this had an additional `strictMode` option that has been
removed in favor of making the strict check the default (and only)
behavior.

Doc and test case are included.

On the client-side
```javascript
var http = require('http');
var url = require('url');
var p = url.parse('http://localhost:8888');
p.headers = {'testing 123': 123};
http.client(p, function(res) { }); // throws
```

On the server-side
```javascript
var http = require('http');
var server = http.createServer(function(req,res) {
  res.setHeader('testing 123', 123); // throws
  res.end('...');
});
```

Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Trevor Norris <trevnorris@nodejs.org>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
PR-URL: https://github.com/nodejs/node/pull/2526
2015-09-25 08:37:57 -07:00
..
api http: add checkIsHttpToken check for header fields 2015-09-25 08:37:57 -07:00
api_assets
tsc-meetings doc: add TSC meeting minutes 2015-09-02 2015-09-06 21:38:08 +10:00
full-white-stripe.jpg installer: fix installers for node.js rename 2015-08-23 17:59:43 -04:00
node.1 doc: update environment vars in manpage and --help 2015-09-06 21:38:08 +10:00
osx_installer_logo.png installer: fix installers for node.js rename 2015-08-23 17:59:43 -04:00
releases.md doc: jenkins-iojs.nodesource.com -> ci.nodejs.org 2015-09-24 00:20:53 +02:00
template.html node: rename from io.js to node 2015-08-23 17:59:43 -04:00
thin-white-stripe.jpg installer: fix installers for node.js rename 2015-08-23 17:59:43 -04:00