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

Already on GitHub? Sign in to your account

Double '/' in URLs causes static content not to load? #663

Closed
SamuelMarks opened this Issue Jan 10, 2013 · 6 comments

Comments

Projects
None yet
5 participants

This static content includes: JavaScript, CSS &etc.

E.g.: http://flask.pocoo.org/docs/patterns// vs. http://flask.pocoo.org/docs/patterns/

apiguy commented Jan 10, 2013

If the src attribute is relative to the current page (as it is in the example you're providing) the browser won't be able to get them. Using your example:

http://flask.pocoo.org/docs/patterns/

The javascript src attributes are like: ../_static/jquery.js

The browser will then use the current url and the src url to try and load:

http://flask.pocoo.org/docs/_static/jquery.js

In the case of 2 slashes:

http://flask.pocoo.org/docs/patterns//

The browser will combine the 2 into:

http://flask.pocoo.org/docs/patterns/_static/jquery.js

Which is incorrect and returns a 404.

This is standard behavior for web browsers, and can be avoided, if you desire, by using more explicit urls for static content.

Owner

untitaker commented Jan 10, 2013

I think a URL like http://flask.pocoo.org/docs/deploying/////// should 404 in the first place.

apiguy commented Jan 10, 2013

@untitaker I totally agree.

Agreed; make it 404. The double-slash error should be treated as such; i.e.: an error.

Alternatively set a rule which redirects > 1 '/' to 1 '/''

Rydgel commented Jan 11, 2013

👍 for 404

Owner

mitsuhiko commented Jan 27, 2013

I am too lazy to reconfigure apache to do that to be honest. :)

@mitsuhiko mitsuhiko closed this Jan 27, 2013

@dodijk dodijk referenced this issue in semanticize/semanticizer Nov 11, 2013

Closed

Multiple slashes are not squashed into one #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment