artifacts / AFCache

AFCache is an HTTP cache for iOS and OSX seeking towards full RFC2616 compliance
Apache License 2.0
361 stars 43 forks source link

URL parsing fails on URLs with port numbers #6

Closed bgulanowski closed 9 years ago

bgulanowski commented 13 years ago

I'm not sure precisely what's happening in -filenameForURLString:, but the handling of the port number substring is broken. The existing regex is invalid (there are two repetition specifiers, when only one is permitted). But when I fixed it (removing the "?"), it caused the hostname and the first element of the path to squeeze together.

Simply ripping out the port is probably a bad idea. It might be better to replace the colon with an underscore. I'm going to try that myself.

artifacts commented 13 years ago

Can you post an example of a broken URL?

bgulanowski commented 13 years ago

http://localhost:3000/blah/

becomes

localhostblah

I modified it to output "localhost_3000/blah"

artifacts commented 9 years ago

won't happen anymore since filenames are hashes now