Skip to content

Conversation

@angrynode
Copy link

Apparently Url::parse and Url::parse_with_params do different things leading to a different encoding and therefore string rep.

In Url::parse, : is preserved across params. That's not the case when using parse_with_params which internally uses query_pairs_mut.

I'm not sure which is correct in the general case. If i understand RFC 3986 they should be encoded in all cases, except when the protocol specifies it.

This PR only contains tests as i'm not familiar with url crate internals.

@Manishearth
Copy link
Member

I'm not sure which is correct in the general case. If i understand RFC 3986 they should be encoded in all cases, except when the protocol specifies it.

n.b. this crate implements https://url.spec.whatwg.org/ not RFC 3986

@angrynode
Copy link
Author

@Manishearth If magnet links are not supposed to be supported feel free to close this PR and i'll open one to write supported schemes in the README. I'm not sure how RFC and WhatWG differ. I see in the spec you linked there is a mailto: example but i don't see much about non-HTTP schemes in general.

@Manishearth
Copy link
Member

I think magnet links should be supported. I'm just saying that you're looking at the wrong standard

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.

2 participants