xui/xui — Issue #63: xhr should allow Http code 201 as successful
Author: will-quast-bohemian
Created: 2011-12-06 21:42:22+00:00
State: open

```
diff --git a/iOS/www/js/lib/xui-2.2.0.js b/iOS/www/js/lib/xui-2.2.0.js
index 1a0e50d..4f35497 100644
--- a/iOS/www/js/lib/xui-2.2.0.js
+++ b/iOS/www/js/lib/xui-2.2.0.js
@@ -1356,9 +1356,11 @@ xui.extend({
req.handleResp = (o.callback != null) ? o.callback : function() { that.html(location, req.responseText); };
req.handleError = (o.error && typeof o.error == 'function') ? o.error : function () {};
function hdl(){
if(req.readyState==4) {
delete(that.xmlHttpRequest);
- if(req.status===0 || req.status==200) req.handleResp();
+ if(req.status===0 || req.status==200 || req.status==201) req.handleResp();
if((/^[45]/).test(req.status)) req.handleError(req.status, req.statusText);
}
}
```

or better yet, shouldnt the status code be checked as number ranges to prevent other bugs of this sort?