mirror of
https://github.com/jsbin/jsbin.git
synced 2026-01-25 15:38:56 +00:00
Now return 404 to bad list request
This commit is contained in:
parent
4d4af1471c
commit
99c1d64b3b
@ -357,8 +357,8 @@ module.exports = Observable.extend({
|
||||
|
||||
if (!username) {
|
||||
// FIXME tmp fix to kick out 404 infinite loop
|
||||
return res.send('<meta http-equiv="refresh" content="0">');
|
||||
// return next(404);
|
||||
// return res.send('<meta http-equiv="refresh" content="0">');
|
||||
return next(404);
|
||||
}
|
||||
|
||||
// TODO: convert to promise
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
|
||||
var $body = $('body'),
|
||||
loaded = false,
|
||||
requestAttempts = 5,
|
||||
$history; // set in hookUserHistory()
|
||||
|
||||
$document.on('history:open', function () {
|
||||
@ -31,8 +32,13 @@
|
||||
dataType: 'html',
|
||||
url: jsbin.root + '/list',
|
||||
error: function () {
|
||||
$('#history').remove();
|
||||
setTimeout(loadList, 500);
|
||||
requestAttempts--;
|
||||
if (requestAttempts > 0) {
|
||||
$('#history').remove();
|
||||
setTimeout(loadList, 500);
|
||||
} else {
|
||||
console.error('Giving up to load history');
|
||||
}
|
||||
},
|
||||
success: function (html) {
|
||||
$('#history').remove();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user