scalatra / rl

because if you need to put 'universal' in the name, it isn't...
https://backchat.io
MIT License
4 stars 3 forks source link

fix url encoding to follow these rules #3

Open casualjim opened 10 years ago

casualjim commented 10 years ago

fix url encoding to follow these rules http://sinophibe.blogspot.nl/2011/07/proper-url-encoding-and-decoding.html

lucastorri commented 10 years ago

Hi,

This might be related: https://github.com/backchatio/rl/issues/3

I am having the same issue. A small test case in a Scalatra project (sbt console):


import rl.UrlCodingUtils
def check(uri: String) = UrlCodingUtils.urlDecode(UrlCodingUtils.ensureUrlEncoding(uri), toSkip = "/?#")

check("/%u002e%u002e%u2215%u002e%u002e%u2215%u002e%u002e%u2215%u002e%u002e%u2215%u002e%u002e%u2215%u002e%u002e%u2215%u002e%u002e%u2215%u002e%u002e%u2215%u002e%u002e%u2215etc%u2215hosts%00")

I'm using Scala 2.10.4 with Scalatra 2.2.2