ljharb / qs

A querystring parser with nesting support
BSD 3-Clause "New" or "Revised" License
8.54k stars 728 forks source link

The ignorequeryprefix configuration did not take effect #437

Closed 794a93f1915701453a2db43f3b55f9a9 closed 2 years ago

794a93f1915701453a2db43f3b55f9a9 commented 2 years ago

ignoreQueryPrefix of parse function is not effective,

Is it because str.replace (/ ^ \? /, '') in the parseQueryStringValues function has no effect,

Should it be replaced with str.replace (/. * \? /, '') 微信图片_20220321174438

ljharb commented 2 years ago

No, it shouldn’t. It’s a query prefix - it only applies if it’s the start of the string.

Perhaps instead of passing the query string, you’re trying to pass a full URL, which this package doesn’t support?

ljharb commented 2 years ago

I see in your screenshot that’s the problem. The query string in your URL is ?a=1&b=2, and it’s up to you to separate that out first before using qs.

794a93f1915701453a2db43f3b55f9a9 commented 2 years ago

I see. Thank you for your answer!