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

Global "duplicates" parameter #51

Closed
paftek opened this Issue Nov 9, 2012 · 5 comments

Comments

Projects
None yet
2 participants
@paftek

paftek commented Nov 9, 2012

Hi and thanks for this great lib!

Working with an URI instance, I cannot find a way to prevent it to remove duplicates (as URI.buildQuery() offers).

Is it possible to have a global flag like : URI.allowDuplicates = true
And / or something on an instance like : uri.allowDuplicates(true)

Thanks!

@rodneyrehm

This comment has been minimized.

Show comment
Hide comment
@rodneyrehm

rodneyrehm Nov 9, 2012

Member

how exactly are you using URI.js? (what are you doing and what are you expecting exactly)

Member

rodneyrehm commented Nov 9, 2012

how exactly are you using URI.js? (what are you doing and what are you expecting exactly)

@paftek

This comment has been minimized.

Show comment
Hide comment
@paftek

paftek Nov 12, 2012

My points:

Goal

I want to replace all my utility methods about URI modifications by a lib doing it the proper way. I mostly modify query strings and compare URI.

Question about duplicates

Event if I cannot find a case yet where I need to send duplicates, my utility methods do not prevent me to do that. I do not want a regression on that specific point by switching to the URI lib.
Is the duplicates removal a part of any specification?

Consistency

If URI.buildQuery() offers me a way to choose if whether or not I want duplicates, why uri.addQuery() cannot?

paftek commented Nov 12, 2012

My points:

Goal

I want to replace all my utility methods about URI modifications by a lib doing it the proper way. I mostly modify query strings and compare URI.

Question about duplicates

Event if I cannot find a case yet where I need to send duplicates, my utility methods do not prevent me to do that. I do not want a regression on that specific point by switching to the URI lib.
Is the duplicates removal a part of any specification?

Consistency

If URI.buildQuery() offers me a way to choose if whether or not I want duplicates, why uri.addQuery() cannot?

@paftek paftek closed this Nov 12, 2012

@paftek paftek reopened this Nov 12, 2012

@rodneyrehm

This comment has been minimized.

Show comment
Hide comment
@rodneyrehm

rodneyrehm Nov 12, 2012

Member

Is the duplicates removal a part of any specification?

hell no. All that is defined is the syntax - but nobody every said anything about semantics. This lead to a lot of different implementations regarding the handling of query strings. ?foo=1&foo=2 is treated as foo = 2 in one environment and as foo = [1, 2] in another.

v1.8.0 is on the doorstep (waiting a couple of days for some possible fix in QUnit). I've already introduced URI.duplicateQueryParameters = true; for global configuration and URI("…").duplicateQueryParameter(true) for instance configuration. Consider your problem solved, just not released yet.

(I'll close the ticket once v1.8.0 is out)

Member

rodneyrehm commented Nov 12, 2012

Is the duplicates removal a part of any specification?

hell no. All that is defined is the syntax - but nobody every said anything about semantics. This lead to a lot of different implementations regarding the handling of query strings. ?foo=1&foo=2 is treated as foo = 2 in one environment and as foo = [1, 2] in another.

v1.8.0 is on the doorstep (waiting a couple of days for some possible fix in QUnit). I've already introduced URI.duplicateQueryParameters = true; for global configuration and URI("…").duplicateQueryParameter(true) for instance configuration. Consider your problem solved, just not released yet.

(I'll close the ticket once v1.8.0 is out)

@paftek

This comment has been minimized.

Show comment
Hide comment
@paftek

paftek Nov 12, 2012

Great, many thanks!

paftek commented Nov 12, 2012

Great, many thanks!

@rodneyrehm

This comment has been minimized.

Show comment
Hide comment
@rodneyrehm

rodneyrehm Nov 13, 2012

Member

Issue resolved with v1.8.0

Member

rodneyrehm commented Nov 13, 2012

Issue resolved with v1.8.0

@rodneyrehm rodneyrehm closed this Nov 13, 2012

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