ljharb / qs

A querystring parser with nesting support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The ignorequeryprefix configuration did not take effect

794a93f1915701453a2db43f3b55f9a9 opened this issue · comments

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

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?

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.

I see. Thank you for your answer!