Created
August 11, 2015 09:23
-
-
Save tarmolehtpuu/e9b414c0ae9006afda73 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?hh | |
function get_app_to_handle_uri(string $uri): { | |
switch ($uri->getProtocol()) { | |
case 'itunes': | |
return ITUNES_APP; | |
case 'irc': | |
return IRC_APP; | |
case 'https': | |
if ($uri->getAuthority()->endsWith('.onion')) { | |
return TOR_BROWSER_APP; | |
} else { | |
return WEB_BROWSER_APP; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment