Skip to content
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

Problem with full URL #2

Closed
amrynsky opened this issue May 4, 2013 · 3 comments
Closed

Problem with full URL #2

amrynsky opened this issue May 4, 2013 · 3 comments
Assignees
Labels

Comments

@amrynsky
Copy link

amrynsky commented May 4, 2013

Attempt to parse the following URL causes the wrong result

var feed = new Url('https://www.google.com/calendar/feeds/test/private-t42423424234/full?start-index=1&max-results=20');
feed.toString() ->> returns
"https://www.google.com:443calendar/feeds/test/private-t42423424234/full?start-index=1&max-results=20"

There are two problems:

  • missing '/' after the host name
  • default port is present in the result url (not nice)

I have fixed it by changing toString() function to the following. Haven't tested it in all scenarios, by with full URL works fine

this.toString = function () {
return (
(this.protocol && (this.protocol + '://')) +
(this.user && (this.user + (this.pass && (':' + this.pass)) + '@')) +
(this.host && this.host) +
((this.port && !(this.port == 443 && this.protocol == 'https') && !(this.port == 80 && this.protocol == 'http')) ? this.port : '') +
(this.path && ('/' + this.path)) +
(this.query.toString() && ('?' + this.query)) +
(this.hash && ('#' + this.hash))
);
};

@ghost ghost assigned Mikhus May 6, 2013
@Mikhus
Copy link
Owner

Mikhus commented May 6, 2013

Which browser do you use?
I've tested under:

  • Chrome 26
  • Firefox 20
  • Opera 12.15

Works well, bug described above is not reproduced.

@amrynsky
Copy link
Author

amrynsky commented May 7, 2013

IE 9

Sent from my iPhone

On May 6, 2013, at 1:24 PM, Mykhailo Stadnyk notifications@github.com wrote:

What is the browser do you use? I've tested under Chrome 26, it works well, bug described above is not reproduced.


Reply to this email directly or view it on GitHub.

@Mikhus
Copy link
Owner

Mikhus commented May 8, 2013

OK, as expected :D, I'll try but it's a bit problematic for the moment as far as I'm on Linux...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants