kopia lustrzana https://github.com/c9/core
Catch errors where header contains invalid characters
rodzic
9fee4dc0b8
commit
700c8b7358
|
@ -162,6 +162,7 @@ define(function(require, exports, module) {
|
||||||
}
|
}
|
||||||
|
|
||||||
debug("proxy call %s", url);
|
debug("proxy call %s", url);
|
||||||
|
try {
|
||||||
httpModule.get({
|
httpModule.get({
|
||||||
path: parsedUrl.path,
|
path: parsedUrl.path,
|
||||||
hostname: parsedUrl.hostname,
|
hostname: parsedUrl.hostname,
|
||||||
|
@ -180,6 +181,15 @@ define(function(require, exports, module) {
|
||||||
metrics.increment("preview.failed.error");
|
metrics.increment("preview.failed.error");
|
||||||
next(err);
|
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) {
|
function handleError(request) {
|
||||||
var body = "";
|
var body = "";
|
||||||
|
|
Ładowanie…
Reference in New Issue