-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
18 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
// meteor algorithm to check if this is a meteor serving http request or not | ||
IsAppUrl = function (url) { | ||
if (url === '/favicon.ico' || url === '/robots.txt') | ||
IsAppUrl = function (req) { | ||
var url = req.url | ||
if(url === '/favicon.ico' || url === '/robots.txt') { | ||
return false; | ||
} | ||
|
||
// NOTE: app.manifest is not a web standard like favicon.ico and | ||
// robots.txt. It is a file name we have chosen to use for HTML5 | ||
// appcache URLs. It is included here to prevent using an appcache | ||
// then removing it from poisoning an app permanently. Eventually, | ||
// once we have server side routing, this won't be needed as | ||
// unknown URLs with return a 404 automatically. | ||
if (url === '/app.manifest') | ||
if(url === '/app.manifest') { | ||
return false; | ||
} | ||
|
||
// Avoid serving app HTML for declared routes such as /sockjs/. | ||
if (RoutePolicy.classify(url)) | ||
if(RoutePolicy.classify(url)) { | ||
return false; | ||
} | ||
|
||
// we currently return app HTML on all URLs by default | ||
return true; | ||
// we only need to support HTML pages only | ||
// this is a check to do it | ||
return /html/.test(req.headers['accept']); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters