Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http: add strictMode option and checkIsHttpToken check #2526

Closed
wants to merge 3 commits into from

Commits on Sep 24, 2015

  1. http: add checkIsHttpToken check for header fields

    Per: nodejs/node-convergence-archive#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('...');
    });
    ```
    jasnell committed Sep 24, 2015
    Configuration menu
    Copy the full SHA
    6f31c9d View commit details
    Browse the repository at this point in the history
  2. test: move header field validity test to parallel, rename

    Rename the header field validity test to remove the `strictmode`
    reference since the `strictMode` check does not exist.
    
    Move the test to parallel instead of sequential
    jasnell committed Sep 24, 2015
    Configuration menu
    Copy the full SHA
    e81befe View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c0a660f View commit details
    Browse the repository at this point in the history