Permalink
Browse files

Twitter URLs should point to HTTPS now that it is the default

  • Loading branch information...
1 parent 2c1dd65 commit f122423a2ffd0c7a55ec3d18c46ae3eee067bceb Jacob Hoffman-Andrews committed Jan 24, 2012
Showing with 7 additions and 7 deletions.
  1. +3 −3 src/com/twitter/Autolink.java
  2. +4 −4 tests/com/twitter/AutolinkTest.java
@@ -19,11 +19,11 @@
/** Default CSS class for auto-linked hashtag URLs */
public static final String DEFAULT_HASHTAG_CLASS = "hashtag";
/** Default href for username links (the username without the @ will be appended) */
- public static final String DEFAULT_USERNAME_URL_BASE = "http://twitter.com/";
+ public static final String DEFAULT_USERNAME_URL_BASE = "https://twitter.com/";
/** Default href for list links (the username/list without the @ will be appended) */
- public static final String DEFAULT_LIST_URL_BASE = "http://twitter.com/";
+ public static final String DEFAULT_LIST_URL_BASE = "https://twitter.com/";
/** Default href for hashtag links (the hashtag without the # will be appended) */
- public static final String DEFAULT_HASHTAG_URL_BASE = "http://twitter.com/#!/search?q=%23";
+ public static final String DEFAULT_HASHTAG_URL_BASE = "https://twitter.com/#!/search?q=%23";
/** HTML attribute to add when noFollow is true (default) */
public static final String NO_FOLLOW_HTML_ATTRIBUTE = " rel=\"nofollow\"";
@@ -14,14 +14,14 @@ public void setUp() {
public void testNoFollowByDefault() {
String tweet = "This has a #hashtag";
- String expected = "This has a <a href=\"http://twitter.com/#!/search?q=%23hashtag\" title=\"#hashtag\" class=\"tweet-url hashtag\" rel=\"nofollow\">#hashtag</a>";
+ String expected = "This has a <a href=\"https://twitter.com/#!/search?q=%23hashtag\" title=\"#hashtag\" class=\"tweet-url hashtag\" rel=\"nofollow\">#hashtag</a>";
assertAutolink(expected, linker.autoLinkHashtags(tweet));
}
public void testNoFollowDisabled() {
linker.setNoFollow(false);
String tweet = "This has a #hashtag";
- String expected = "This has a <a href=\"http://twitter.com/#!/search?q=%23hashtag\" title=\"#hashtag\" class=\"tweet-url hashtag\">#hashtag</a>";
+ String expected = "This has a <a href=\"https://twitter.com/#!/search?q=%23hashtag\" title=\"#hashtag\" class=\"tweet-url hashtag\">#hashtag</a>";
assertAutolink(expected, linker.autoLinkHashtags(tweet));
}
@@ -51,14 +51,14 @@ public void testURLWithoutProtocol() {
public void testWithAngleBrackets() {
linker.setNoFollow(false);
String tweet = "(Debugging) <3 #idol2011";
- String expected = "(Debugging) &lt;3 <a href=\"http://twitter.com/#!/search?q=%23idol2011\" title=\"#idol2011\" class=\"tweet-url hashtag\">#idol2011</a>";
+ String expected = "(Debugging) &lt;3 <a href=\"https://twitter.com/#!/search?q=%23idol2011\" title=\"#idol2011\" class=\"tweet-url hashtag\">#idol2011</a>";
assertAutolink(expected, linker.autoLink(tweet));
}
public void testUsernameIncludeSymbol() {
linker.setUsernameIncludeSymbol(true);
String tweet = "Testing @mention and @mention/list";
- String expected = "Testing <a class=\"tweet-url username\" href=\"http://twitter.com/mention\" rel=\"nofollow\">@mention</a> and <a class=\"tweet-url list-slug\" href=\"http://twitter.com/mention/list\" rel=\"nofollow\">@mention/list</a>";
+ String expected = "Testing <a class=\"tweet-url username\" href=\"https://twitter.com/mention\" rel=\"nofollow\">@mention</a> and <a class=\"tweet-url list-slug\" href=\"https://twitter.com/mention/list\" rel=\"nofollow\">@mention/list</a>";
assertAutolink(expected, linker.autoLink(tweet));
}

0 comments on commit f122423

Please sign in to comment.