New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String sniffing fixes for URLs #1594
Conversation
If none of the beautiful URL testing tests fail now, then that's good enough for me :D Is it worth adding a test for a search URL with a port only?
That works now, but it may be worth testing it for the future... maybe |
Can't hurt. I might also take this opportunity to add a small pet feature relating to URLs. |
Ooooh I'm waiting! My merge finger is frozen :) On 17 Medi 2013, at 11:29, Rob McBroom notifications@github.com wrote:
|
Easier to read and modify.
qsapp/ will become http://www.qsapp.com/ The URL pattern is localized, so it can potentially be used in other countries. Tests for this type of input were also added.
OK, it's ready to be looked over. |
// Check the port (if it exists). URLs may contain multiple colons, so we take the first occurance of it. e.g. http://google.com:80/?q=this_is_a_: | ||
NSString *port = [[[colonComponents objectAtIndex:1] componentsSeparatedByString:@"/"] objectAtIndex:0]; | ||
NSString *port = [colonComponents objectAtIndex:1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the stance on object-literal access ? e.g colonComponents[1]
. I'm using that now, and it sure feels leaner. (There's one above and one below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love all the new syntax. Long overdue. And we've agreed to allow it since 10.6 was dropped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I've added info to the wiki page:
http://qsapp.com/wiki/Github
I haven't mentioned indentation, but just referenced the LLVM docs ;-)
Other than that, looks good. Nice to see a test ;-). EDIT: I'll try to keep the IRC alive and cozy tonight, if you guys are around. |
+1 for the tests and localisation :) Strange, |
I think we talked about this before. I couldn't remember if it didn't work for you or if it wasn't useful since it assumes a U.S. URL. I suspect they didn't make the behavior internationally friendly. So once again, QS has more to offer than the built-in tools. Maybe try changing to the U.S. in system prefs? (If you even care to see it. I think you get the idea.) Safari on iOS also does this if you want to give that a try. In fact, if you type "qsapp" in Mobile Safari and hit Go, you might see it change to "qsapp/" for a fraction of a second before being expanded. Something else I realized while working on this: We shouldn't be allowing URLs where one of the components begins or ends with |
Now you mention it I do seem to remember. Works on iOS. Kind of a quirky thing though. Does this mean that when I type
I'm fine with that. It's much more robust than Apple's URL sniffing anyways :) |
Yes, I suppose it will. Is that really a problem, though? |
Not especially, just checking ;-) I know I won't use this (well, I can't in Safari either, so it's not normal for me), so it would be a minor annoyance, but nothing major. (FYI: I tried changing my language to 'English' and my 'region' to US, but the page still doesn't load in Safari. It's not some extension you have is it?) On 19 Medi 2013, at 02:49, Rob McBroom notifications@github.com wrote:
|
For reference: http://hints.macworld.com/article.php?story=20120919001200353 On 19 Sep 2013, at 17:13, Patrick Robertson robertson.patrick@gmail.com wrote:
|
Yeah, I actually suspected DNS settings too and was about to point that out.
|
I don't have |
Seems it is a domain thing - but only in Safari ?! :S I use this: http://www.opendns.com/technology/dnscrypt/ I just disabled it and now I get the wonderful .com completion ;-) On 19 Sep 2013, at 23:31, Rob McBroom notifications@github.com wrote:
|
P.S. If you're prone to DNS poisoning (the EU and US fast approaching the the same levels of web restrictions as China, who use it) then DNSCrypt works a treat On 19 Sep 2013, at 23:45, Patrick Robertson robertson.patrick@gmail.com wrote:
|
Sounds cool, but I have things at home and especially at work that aren't in public DNS, so OpenDNS wouldn't be able to resolve them. :-( |
I was gonna say that OpenDNS has a feature for that - it's called 'shortcuts' http://blog.opendns.com/2007/04/22/shortcut-the-web/ DNSCrypt does have a setting for bypassing certain domains as well: Your problem sounds interesting - do you have your own DNS for your custom domain resolving, or just a hosts file edit or something? On 20 Sep 2013, at 00:36, Rob McBroom notifications@github.com wrote:
|
I have a DNS server at home that all the devices in house use. No tricky redirection or spoofing for me. :-) At work, we have “internal” and public-facing DNS. Pretty much everything I touch only exists internally. |
I guessing more complicated world than the one I live it. All I need is GitHub and Facebook (although not in China :P) Interesting though :)
|
In working with Howard on #1553, I ran across a bug with this search URL:
while adding a port would make it work as expected
You can test this by running ⌘⎋ on both of those and checking the default action.
So, I added some unit tests for various colon placement combinations, then changed the string sniffing code so the tests would pass.
In a nutshell, all I did was split on
/
first before splitting on:
. That way, we only worry about colons in thehostname:port
part of the URL. All other colons are ignored.