sergot / http-useragent

Web user agent class for Perl 6.
MIT License
36 stars 39 forks source link

Hash order was changed in the last release #200

Closed JJ closed 6 years ago

JJ commented 6 years ago

Now it's guaranteed to always be different. You have to return always sorted keys. Hope this fixes the problem with 2018.05

AlexDaniel commented 6 years ago

Is it really a good idea to spend extra cycles for sorting stuff that is valid in any order? @samcv what do you think? Or is it good because it does not leak out the seed this way?

Maybe it would be better if the test understood that the result is correct even if the order is different?

JJ commented 6 years ago

I don't know. It's probably better if the result of this kind of thing is deterministic, since it's a string. It would not make much sense to return a different string every time. You will have to live with that if it's stringified; if you don't want to spend the cycles, stringify it yourself...

samcv commented 6 years ago

I think we should sort it before stringifying.

ugexe commented 6 years ago

Header order should be preserved. For instance: bot detection heuristics often use header order to check if header FOO is used before or after header BAR.

AlexDaniel commented 6 years ago

OK.

ugexe commented 6 years ago

to clarify: I am against this PR. only the tests themselves should be modified.

AlexDaniel commented 6 years ago

OK, reverted the merge for now.

AlexDaniel commented 6 years ago

Uh, anyone looking at this?