Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Respect ports in JX.URI

Summary: durrrrrp

Test Plan: My local install on 8080 works better now. New test passes.

Reviewers: vrana, btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D3573
  • Loading branch information...
commit f1de6ce8cdf2796f73779ac28c955167203fda17 1 parent cad107b
@epriestley epriestley authored
Showing with 6 additions and 1 deletion.
  1. +4 −0 src/lib/URI.js
  2. +2 −1  src/lib/__tests__/URI.js
View
4 src/lib/URI.js
@@ -185,6 +185,10 @@ JX.install('URI', {
}
str += this.getDomain() || '';
+ if (this.getPort()) {
+ str += ':' + this.getPort();
+ }
+
// If there is a domain or a protocol, we need to provide '/' for the
// path. If we don't have either and also don't have a path, we can omit
// it to produce a partial URI without path information which begins
View
3  src/lib/__tests__/URI.js
@@ -4,9 +4,10 @@
describe('Javelin URI', function() {
it('should understand parts of a uri', function() {
- var uri = JX.$U('http://www.facebook.com/home.php?key=value#fragment');
+ var uri = JX.$U('http://www.facebook.com:123/home.php?key=value#fragment');
expect(uri.getProtocol()).toEqual('http');
expect(uri.getDomain()).toEqual('www.facebook.com');
+ expect(uri.getPort()).toEqual('123');
expect(uri.getPath()).toEqual('/home.php');
expect(uri.getQueryParams()).toEqual({'key' : 'value'});
expect(uri.getFragment()).toEqual('fragment');
Please sign in to comment.
Something went wrong with that request. Please try again.