projects
/
cwebfiles.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bb0bbf3
)
handle server which aren't cgi "Status" aware
master
author
Jann Horn
<jannhorn@googlemail.com>
Tue, 13 Nov 2012 17:51:58 +0000
(18:51 +0100)
committer
Jann Horn
<jannhorn@googlemail.com>
Tue, 13 Nov 2012 17:51:58 +0000
(18:51 +0100)
static/index.html
patch
|
blob
|
history
diff --git
a/static/index.html
b/static/index.html
index
1e6adcc
..
995d45b
100644
(file)
--- a/
static/index.html
+++ b/
static/index.html
@@
-27,12
+27,18
@@
function cgireq(script, qs, body, cb) {
req.open((body!=null)?'POST':'GET', '/cgi-bin/cwebfiles/'+script+(qs?'?'+qs:''), !!cb)
if (cb) {
req.onloadend = function() {
req.open((body!=null)?'POST':'GET', '/cgi-bin/cwebfiles/'+script+(qs?'?'+qs:''), !!cb)
if (cb) {
req.onloadend = function() {
- cb(req.status, req.responseText)
+ var status = req.getResponseHeader("Status") || req.status.toString(10)
+ status = status.split(' ')[0]
+ status = parseInt(status, 10)
+ cb(status, req.responseText)
}
}
req.send(body)
if (!cb) {
}
}
req.send(body)
if (!cb) {
- return {status: req.status, data: req.responseText}
+ var status = req.getResponseHeader("Status") || req.status.toString(10)
+ status = status.split(' ')[0]
+ status = parseInt(status, 10)
+ return {status: status, data: req.responseText}
}
}
}
}