Comments (5)
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
)
from ufo.
Hi @yshrsmz. While it is true about SearchParams behavior, withQuery version is properly parsed by URL (spec is splitting by &
).
// k1=v1&k2=v2
console.log(new URL('https://example.com?p=k1=v1%26k2=v2').searchParams.get('p'))
Do you have an example that current behavior is making problems?
from ufo.
Hi @pi0
Do you have an example that current behavior is making problems?
I'm not 100% sure but one of my clients seems to have very naive query parsing logic and =
in query value seems to be causing a problem for them(like split by ?
, split by &
, and then split by =
).
So I thought it would great if ufo can support encoding =
char.
from ufo.
I see. Implementing a change would be easy but since the goal of ufo is to stick with the standard and do less possible encoding in normalized/stringified URLs, I need better context of what clients (browser?) do not properly work.
from ufo.
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 :)
from ufo.
Related Issues (20)
- fix: `normalizeURL` does not ensure path name starts with a `/` HOT 4
- Encoding query arrays with `name[]` convention HOT 7
- Only apply trailing slash utilities to supported protocols HOT 3
- Add a `withHash` function
- `searchParams` and `query` cannot be correctly mutated on $URL instance HOT 1
- Query parameter encoding - slash character does not get encoded HOT 3
- Add a without hash/fragment utility HOT 2
- Migrate to native `URL` HOT 2
- Utility to get url without host (path + query + [hash]) HOT 5
- withoutTrailingSlash incorrectly strips slash from last query parameter
- `joinRelativeURL` doesn't handle protocols
- Regex JOIN_SEGMENT_SPLIT_RE broke nuxt app HOT 5
- SyntaxError: Invalid regular expression: invalid group specifier name (Safari) HOT 1
- Additional utils: keepQuery and withoutQuery HOT 1
- Please encode " | " as %7C
- `withProtocol` stips host when input is in `{host}:{post}` format HOT 2
- withQuery do not encode ';'
- protocol relative when using `withProtocol`
- Add `withPathParameters`
- Edge case where leading slash is removed in normal URL paths
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 ufo.