Comments (2)
I wouldn't insist on "severity" actually :) My practical case was about the API requires request body payload to be accompanied by a signature header calculated on the string represented by param1=value1¶m2=value2
pairs of actual JSON payload. Possible workaround in my case is to use a query string to pass all the params I need. Or to relay on map
for both payload forming and signature generation.
Another type of problem I can think about is when values of the params with the same names are overridden by the latter ones under some circumstances... not critical either.
Suppose we can close the issue then
from go-querystring.
Thanks for the report. I suspect that this is because url.Values
is a map[string][]string
, whose key access is by definition unordered. There's not really much go-querystring can do about that. That's a good callout though, and we could certainly add a reminder in the docs somewhere that if stable ordering is needed, then the caller will need to handle that. I haven't looked, but I would imagine encoding/json
doesn't have this problem because it's using its own internal data structures rather than maps.
I'm curious though, is this causing problems in practice? You mention signatures, but I would assume that signatures would be generated on the output of encoding the url.Values
, so as long as you're generating the signature on the same encoding that is passed in a URL, then the ordering shouldn't matter. And I don't say that to dismiss the concern... only to better understand the severity.
from go-querystring.
Related Issues (20)
- Support alternative struct tags (instead of `url`) HOT 6
- Allow arbitrary delimiter for slice/array type params
- Parsing query strings into a map HOT 3
- Support for Unmarshaler / Marshaler HOT 2
- "query string" for GitHub search HOT 1
- add `decode` method HOT 1
- Slice (Array) pointer does not result in array query values HOT 1
- Is there a way to write a custom marshaller for my custom type? HOT 1
- Unable to handle nil pointers when implementing Encoder HOT 6
- can you please update the tag? HOT 3
- Querystring not adding [] for the array types HOT 1
- Add support for JSON encoding a struct field
- Different behavior on encoding empty slice with any del tag and without HOT 2
- Supporting slices HOT 2
- Custom `String` implementations are not respected HOT 7
- Support RFC Specific Encoding HOT 7
- How to encode nested structure by my way? HOT 1
- Support pointer method (*Type)EncodeValues on the Encoder interface HOT 2
- Add support for struct field name casing options
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-querystring.