Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't return placeholder HTML for non-existing .js files #222

Open
yanamal opened this issue Mar 20, 2016 · 0 comments
Open

Don't return placeholder HTML for non-existing .js files #222

yanamal opened this issue Mar 20, 2016 · 0 comments

Comments

@yanamal
Copy link

yanamal commented Mar 20, 2016

I'm playing around with loading third-party .js libraries (including ones that are only available when the page is viewed through a special browser), and the libraries, in turn, sometimes try to load other .js files where they assume an incorrect (local) path.

So I often end up asking for a url like yanamal.pencilcode.net/.../*.js which does not exist.
But for all non-existent URLs, pencil code returns a placeholder HTML page:

<pre>
No file doggames/cordova.js found.

<a href="/doggames/">Up to /doggames/</a>
<a href="/edit/doggames/cordova.js" rel="nofollow">Create /home/doggames/cordova.js</a>
</pre>

So when the script tries to parse that as javascript, it gets very confused and throws:
Uncaught SyntaxError: Unexpected token <
which isn't very helpful.

I think it'd be better if, for requests that are .js or other clearly non-html extensions, it either gave a clearer 404 or maybe even returned a completely blank file (well, a blank would be best in my particular use case, anyway).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant