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

Handle trailing slashes in parse and toString #7

Merged
merged 1 commit into from
Feb 24, 2016
Merged

Handle trailing slashes in parse and toString #7

merged 1 commit into from
Feb 24, 2016

Conversation

jeddeloh
Copy link
Contributor

This adds handling for trailing slashes. For documentation: we opted for hasTrailingSlash over simply keeping "" in path segments because a lot of unexpected things can come up once you start working path segments that contain "".

@@ -322,6 +327,7 @@ parse str =
hash = (hashFromAll str),
password = "",
path = (pathFromAll str),
hasTrailingSlash = (hasTrailingSlashFromAll str),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm extracting the path twice here, but I thought I'd ask if that's an optimization you actually wanted before I went making bigger changes.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is an issue at all, it will be quite fast

@sporto
Copy link
Owner

sporto commented Feb 24, 2016

Thanks for this, will add a couple more test and publish

sporto pushed a commit that referenced this pull request Feb 24, 2016
Handle trailing slashes in parse and toString
@sporto sporto merged commit 4ef7599 into sporto:master Feb 24, 2016
@sporto
Copy link
Owner

sporto commented Feb 24, 2016

Published v 9.0

@jeddeloh
Copy link
Contributor Author

Awesome. Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants