http module, semicolon in POSTs badly encoded · Issue #356 · walterhiggins/ScriptCraft · GitHub
Skip to content

http module, semicolon in POSTs badly encoded #356

Open

Description

@Gloorf

If you try to do a POST request with semicolon inside the data, the post data after the semicolon will be ignored. Sample code :

var http = require('http');
var receiver = self;
  http.request( {
     url: 'https://dpaste.de/api/',
    method: 'POST',
     params: {'expires': 3600,
     'format': 'url',
     'content': 'data;ignored data'}
   }, function(code, body) {	
          echo(receiver, body);
    });

The generated paste will not contain the ";ignored data" part.

The problem arise because we use encodeURI to generate the parameters string, see here in paramsToString, where we should be using encodeURIComponent (at least based on my understanding on when to use it) - which does solves the problem.

Activity

  1. self-assigned this
    on Nov 5, 2017
  2. added this to the 3.3.1 milestone on Nov 5, 2017
  3. added a commit that references this issue on Nov 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions