Merge pull request +14198 from c9/preview-fix-invalid-characters-in-header

Catch errors where header contains invalid characters
pull/315/head
Tim Robinson 2016-06-14 13:18:41 -04:00 zatwierdzone przez GitHub
commit aa3b127c5a
1 zmienionych plików z 27 dodań i 17 usunięć

Wyświetl plik

@ -162,6 +162,7 @@ define(function(require, exports, module) {
}
debug("proxy call %s", url);
try {
httpModule.get({
path: parsedUrl.path,
hostname: parsedUrl.hostname,
@ -180,6 +181,15 @@ define(function(require, exports, module) {
metrics.increment("preview.failed.error");
next(err);
});
} catch (e) {
logError(new Error("httpModule.get threw unexpected error"), {
message: e.message,
url: url,
headers: req.headers
});
metrics.increment("preview.failed.error");
return next(new error.BadRequest(e.message));
}
function handleError(request) {
var body = "";