Skip to content

Commit 3438cbb

Browse files
committed
#28 fix query parser + to space
1 parent 29f1977 commit 3438cbb

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rtjscomp",
3-
"version": "0.9.8",
3+
"version": "0.9.9",
44
"description": "php-like server but with javascript",
55
"repository": {
66
"type": "git",

rtjscomp.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const LINENUMBER_REG = /:([0-9]+)[\):]/;
2929
const PATH_CONFIG = 'config/';
3030
const PATH_DATA = 'data/';
3131
const PATH_PUBLIC = 'public/';
32+
const PLUS_REG = /\+/g;
3233
const RESOLVE_OPTIONS = {paths: [require('path').resolve()]};
3334
const SERVICE_REQUIRE_REG = /\bservice_require\(([^)]*)\)/g;
3435
const SERVICE_STATUS_PENDING = 0; // just added to list
@@ -51,7 +52,7 @@ const log_verbose_flag = process.argv.includes('-v');
5152
let log_verbose = log_verbose_flag;
5253
let port_http = 0;
5354
let port_https = 0;
54-
let upload_limit = 10 * 1024 * 1024;
55+
let upload_limit = 0;
5556
let compression_enabled = true;
5657
let exiting = false;
5758
/// any path -> file
@@ -942,7 +943,9 @@ const querystring_parse = (querystring, result) => {
942943
if (!key) {
943944
throw 'key is empty';
944945
}
945-
value = decodeURIComponent(value || '');
946+
value = decodeURIComponent(
947+
(value || '').replace(PLUS_REG, ' ')
948+
);
946949
if (key in result) {
947950
if ((result[key] instanceof Array) !== array) {
948951
throw 'type mismatch';

0 commit comments

Comments
 (0)