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

Catch Double Forward Slashes in the URL Path #386

Closed
FelicianoTech opened this issue Feb 22, 2017 · 4 comments
Closed

Catch Double Forward Slashes in the URL Path #386

FelicianoTech opened this issue Feb 22, 2017 · 4 comments

Comments

@FelicianoTech
Copy link

URLs such as the following, http://example.com/blog//my-first-post/, passes HTML Proofer. This causes an issue for me because double forward slashes aren't part of proper URLs. Some servers will process it, some will throw a 404.

HTML Proofer should catch a double slash in the path as an error. Or at least, put that functionality behind a flag.

Note, this is not to be confused with protocol relative URLs, //example.com/blog/my-first-post/. That's a perfectly fine URL. I'm not complaining about that nor should support for that change.

@fulldecent
Copy link
Collaborator

That URL is perfectly valid and therefore should not be flagged by html-proof as an error.

Relevant authority: RFC 3986

Discussion: http://stackoverflow.com/a/10161264/300224

My recommendation is to close this issue.

@gjtorikian
Copy link
Owner

I'm going to have to abide by the RFC on this one, sorry.

However, it's also possible to write your own tests, so perhaps that will work for you? https://github.com/gjtorikian/html-proofer#custom-tests

@FelicianoTech
Copy link
Author

I find it difficult to read through that RFC but it everyone is in agreement that it's allow, okay. I'll look into a custom test.

@fulldecent
Copy link
Collaborator

@FelicianoTech Don't read the RFC, here is a quick experiment you can try (I should probably put this on SO somewhere):

cat > tmp.php <<'EOF'
<?php
echo $_SERVER['REQUEST_URI'];
EOF
php -S localhost:4000 tmp.php

Now open your browser to http://localhost:4000/hello//world

It loads.

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

3 participants