Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix - to _ rewriting for env variables in Servlet handler.

Use utf8 as default in String decoding.
  • Loading branch information...
commit 07124124ae544c6a917bc59e3f74c2049ccdb5b4 1 parent 2865c07
@gmosx gmosx authored
Showing with 5 additions and 5 deletions.
  1. +1 −1  lib/jack/handler/servlet.js
  2. +4 −4 lib/jack/utils.js
View
2  lib/jack/handler/servlet.js
@@ -22,7 +22,7 @@ Servlet.process = function(app, request, response) {
{
var name = String(e.nextElement()),
value = String(request.getHeader(name)), // FIXME: only gets the first of multiple
- key = name.replace("-", "_").toUpperCase();
+ key = name.replace(/-/g, "_").toUpperCase();
if (key != "CONTENT_LENGTH" && key != "CONTENT_TYPE")
key = "HTTP_" + key;
View
8 lib/jack/utils.js
@@ -101,7 +101,7 @@ exports.parseMultipart = function(env, options) {
contentLength -= boundaryLength;
- var status = input.read(boundaryLength).decodeToString();
+ var status = input.read(boundaryLength).decodeToString("UTF-8");
if (status !== boundary + EOL)
throw new Error("EOFError bad content body");
@@ -151,7 +151,7 @@ exports.parseMultipart = function(env, options) {
if (!bytes)
throw new Error("EOFError bad content body");
- var c = bytes.decodeToString();
+ var c = bytes.decodeToString("UTF-8");
buf += c;
contentLength -= bytes.length;
@@ -176,7 +176,7 @@ exports.parseMultipart = function(env, options) {
"filename" : filename,
"type" : contentType,
"name" : name,
- "tempfile" : tempfile || body.toByteString(), // body
+ "tempfile" : tempfile || body.toByteString("UTF-8"), // body
"head" : head
};
if (filename) {
@@ -187,7 +187,7 @@ exports.parseMultipart = function(env, options) {
data.filename = filename.match(/^(?:.*[:\\\/])?(.*)/m)[1];
}
} else {
- data = body.decodeToString();
+ data = body.decodeToString("UTF-8");
}
if (name) {
Please sign in to comment.
Something went wrong with that request. Please try again.