question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect handling of arrays?

See original GitHub issue

Currently if query-string encounters an array it encodes it without brackets:

> require('query-string').stringify({foo: ['bar', 'baz']})
'foo=bar&foo=baz'

However that seems to go against the default browser behavior or one of other languages such as PHP. Shouldn’t it be foo[]=bar&foo[]=baz?

I know this is kind of a grey area of the RFC but that struck me as odd, is this intended?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
SamVerschuerencommented, Jun 27, 2016

I believe this is intended. All node frameworks handle it correctly.

0reactions
sindresorhuscommented, Jan 12, 2017

Fixed by #79.

Read more comments on GitHub >

github_iconTop Results From Across the Web

5. Common Errors Using Arrays
Accessing elements outside the array can lead to unpredictable results and is a serious error in logic.
Read more >
Common mistakes with arrays - Physics and Astronomy
Going over the end of the array ; This has no chance of success as the incorrect call is trying to say "create...
Read more >
Incorrect handling of arrays in ABI · Issue #419 · ethereum/fe
The ABI type that we produce for this is bytes100 which seems to indicate a sequence of 100 bytes but not actually formatted...
Read more >
Array in C containing Incorrect Values - Stack Overflow
I feel as if there is something wrong with how I am interacting between the array and the pointer variables, but I am...
Read more >
RangeError: invalid array length - JavaScript - MDN Web Docs
The JavaScript exception "Invalid array length" occurs when specifying an array length that is either negative, a floating number or exceeds ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found