aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-09-19 00:54:10 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-09-19 00:54:10 +0200
commit7ced539be325398fc7ecace31201bf89e6335f48 (patch)
treee3a3318fcf3e9e28de0361fd4d7fc3f0c2e30a7e /lib
parentc2a09508ae88149e615bd8f393858dd927f491cf (diff)
downloadbugzilla-triage-7ced539be325398fc7ecace31201bf89e6335f48.tar.gz
Add checking of HTTP status in rhbzpage.showAttachment
Diffstat (limited to 'lib')
-rw-r--r--lib/rhbzpage.js20
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/rhbzpage.js b/lib/rhbzpage.js
index 8dff5be..a3660ad 100644
--- a/lib/rhbzpage.js
+++ b/lib/rhbzpage.js
@@ -343,17 +343,23 @@ RHBugzillaPage.prototype.pasteBacktraceInComments = function() {
}
};
+// FIXME opens wrong attachment id
+// https://bugzilla.redhat.com/show_bug.cgi?id=571846
+// has attachment id https://bugzilla.redhat.com/attachment.cgi?id=448235
+// but this opens https://bugzilla.redhat.com/show_bug.cgi?id=571846
RHBugzillaPage.prototype.showAttachment = function showAttachment(id) {
var that = this;
Request({
- url: "https://" + this.hostname + "/attachment.cgi?id=" + id,
+ url: "https://" + that.hostname + "/attachment.cgi?id=" + id,
onComplete: function () {
- var infoWin = that.win.open("", "Check att. " + id,
- "width=640,height=640,status=no,location=no,"+
- "titlebar=no,scrollbars=yes,resizable=yes");
- var doc = infoWin.document;
- doc.body.innerHTML = "<pre id='textPre'>"+
- this.response.text + "</pre>";
+ if (this.response.status == 200) {
+ var infoWin = that.win.open("", "Check att. " + id,
+ "width=640,height=640,status=no,location=no,"+
+ "titlebar=no,scrollbars=yes,resizable=yes");
+ var doc = infoWin.document;
+ doc.body.innerHTML = "<pre id='textPre'>"+
+ this.response.text + "</pre>";
+ }
}
}).get();
};