Skip to content

Commit e163402

Browse files
committed
[lib] when checking for newer URLs, return false if the result is anything besides http.status=200
1 parent bf67050 commit e163402

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/bootstraplesson.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
/*******************************************
22
* IDENTIFY OLD VERSIONS
33
*******************************************/
4-
function UrlExists(url) {
4+
function UrlExists(url) {
55
var http = new XMLHttpRequest();
66
http.open('HEAD', url, false); // TODO: change this to 'true' and use a promise to render the out of date banner
77
http.send();
8-
return (http.status !== 404)
8+
console.log('checking for', url, 'status is', http.status)
9+
return (http.status == 200)
910
}
1011

1112
function isNewest() {
@@ -34,6 +35,7 @@
3435
}
3536
}
3637

38+
3739
/*******************************************
3840
* ATTACH OPEN/CLOSE EVENTS TO LESSON SIDEBAR
3941
*******************************************/

0 commit comments

Comments
 (0)