equal char in query value is not encoded
See original GitHub issueI have a usecase which requires me to pass a query-string-like string as a query value.
import { withQuery } from 'ufo'
const url = withQuery('https://example.com', { p: 'k1=v1&k2=v2' })
const url2 = new URL('https://example.com')
url2.searchParams.set('p', 'k1=v1&k2=v2')
console.log('withQuery', url)
console.log('URL', url2.href)
The above sample prints the following results.
withQuery https://example.com?p=k1=v1%26k2=v2
URL https://example.com/?p=k1%3Dv1%26k2%3Dv2
As you can see, ufo does not encode =
char while URL does.
Is there any reason to not escape equal char in a query value? Would be great if ufo can encode equal char as well.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Why do some query strings work even if parameters are not ...
The url parameter, http://journals.plos.org/plosone/s/file?id=wjVg/PLOSOne_formatting_sample_main_body.pdf , is not encoded. It contains ...
Read more >Encoding issue for query parameter #1133 - OpenFeign/feign
It seems that in some cases, the query parameters are not encoded correctly. Some special characters like, e.g. equal sign (=) or quotes...
Read more >Manage Unicode Characters in Data Using T-SQL - SQLShack
In this article, we'll give some valuable information on how to use Unicode in SQL Server and various problems that arise from the...
Read more >12.8 String Functions and Operators - MySQL :: Developer Zone
CHAR () interprets each argument N as an integer and returns a string consisting of the characters given by the code values of...
Read more >Guide to Java URL Encoding/Decoding - Baeldung
Simply put, URL encoding translates special characters from the URL to a representation that adheres to the spec and can be correctly ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry, I mean “customer” by “client”.
I need to create a URL for my partner company’s web service(e.g.
https://example.com/login?callbackState=k1=v1%26k2=v2
)Can you possibly please ask him/her about what library/software is used and broken? That would help a lot deciding about this. In the meantime i will double check whatwg parser. Worst case we can add a flag for this 😃