Comments (7)
Probably worth checking if there are any other 'dodgy' but not illegal characters that should also be escaped?
from scala-uri.
Agreed. I've added curly braces in be638f2 and some other characters such as new lines in a8a64d3 . This change should be available in the 0.3-SNAPSHOT.
I agree it makes sense to try and play nice with java.net.URI
, so I'll leave this ticket open, until I have time to look through that code to work out exactly all the characters need to be encoded.
from scala-uri.
Ah cool, thanks for looking into this.
As mentioned before we don't really want to depend on a snapshot, so if you let me know when you push a new release that would be awesome.
from scala-uri.
Hi,
I've pushed version 0.3
out, so you can use that now. It should have the fix for {``}
characters.
I still haven't got round to investigating all the characters that need to be encoded to play well with java.net.URI
, so I will leave this ticket open for now.
from scala-uri.
I got lost in the character class masks in java.net.URI trying to find exactly which characters must be encoded to play nice with java.net.URI
, so instead thought it would be easier to bute force it with this code. scala-uri encodes anything not in the ASCII range, so I only checked ASCII chars:
var ok = List[Char]()
var notOk = List[Char]()
(0 until 128).foreach(i => {
try {
URI.create(i.toChar.toString)
ok = i.toChar :: ok
} catch {
case e:Exception => {
notOk = i.toChar :: notOk
}
}
})
println("OK:" + ok.mkString)
println("NOT OK:" + notOk.mkString)
Results are:
OK:~zyxwvutsrqponmlkjihgfedcba_ZYXWVUTSRQPONMLKJIHGFEDCBA@?=;9876543210/.-,+*)('&$#!
NOT OK:}|{`^]\[><:%"
\
was the only NOT OK character that scala-uri wasn't encoding, so added here: 01c00bb
from scala-uri.
Awesome, thanks for fixing this.
Usual question, can you let me know when this is added to an official release? :)
from scala-uri.
Sorry for the delay. I've now published a 0.3.3
release which includes this.
from scala-uri.
Related Issues (20)
- Trailing slashes are not normalized HOT 3
- Empty Params are not accepted in MatrixParam HOT 1
- Valid characters '+', '-' and '.' in scheme not allowed
- Encoding seems broken HOT 1
- Domain names are preprended with '/' HOT 1
- Support for tld HOT 8
- incorrect publicSuffix matching HOT 5
- Having / and ? next to each other isn't possible HOT 2
- Feature request: Query string parsing HOT 1
- A URISyntaxException is thrown parsing the following url: https://krownlab.com/products/hardware-systems/baldur/#baldur-top-mount#1 HOT 5
- URIs the do not have '//' after 'scheme:' HOT 1
- DSL for v1 HOT 3
- Passing a [/ returns a valid URI? HOT 1
- Try(Uri.parse("%error")) still writes a traceback to stdout/stderr HOT 2
- toURI for local file HOT 2
- Support Scala 2.12 HOT 7
- Runtime exception on matrixParams HOT 1
- Spaces encoded as '+' characters don't decode HOT 2
- Equals-signs in URI fragment are unnecessarily escaped HOT 1
- Characters after '#' is encoded even if part of valid URL HOT 4
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 scala-uri.