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

Preserve port and user/pass info for path-based resources #1353

Merged
merged 1 commit into from
Dec 10, 2013

Conversation

dhedlund
Copy link
Contributor

@dhedlund dhedlund commented Dec 9, 2013

User credentials and port were not being preserved when pre-fetching path-based resources. For example, consider the following HTML:

<html>
  <body>
    <img src="logo.png" />
  </body>

Running the following command would try to fetch the image from http://localhost/my-site/logo.png and crash the browser with ConnectionRefused error:

$ ./servo http://foo:bar@localhost:8080/my-site/
task '<unnamed>' failed at 'Unhandled condition: io_error: rt::io::IoError{kind: ConnectionRefused, desc: "connection refused", detail: None}', /home/daniel/Programming/servo/src/compiler/rust/src/libstd/condition.rs:131
...

This should now be fixed.

@metajack
Copy link
Contributor

metajack commented Dec 9, 2013

Awesome! This looks much nicer. Just need to fix protocol relative URLs and it'll be good to go.

@dhedlund
Copy link
Contributor Author

dhedlund commented Dec 9, 2013

For some reason associated "//..." with same host. Should be fixed now with a new test.

@brson
Copy link
Contributor

brson commented Dec 9, 2013

Thanks, @dhedlund! So many awesome PRs.

bors-servo pushed a commit that referenced this pull request Dec 10, 2013
User credentials and port were not being preserved when pre-fetching path-based resources.  For example, consider the following HTML:

```html
<html>
  <body>
    <img src="logo.png" />
  </body>
```

Running the following command would try to fetch the image from `http://localhost/my-site/logo.png` and crash the browser with ConnectionRefused error:
```
$ ./servo http://foo:bar@localhost:8080/my-site/
task '<unnamed>' failed at 'Unhandled condition: io_error: rt::io::IoError{kind: ConnectionRefused, desc: "connection refused", detail: None}', /home/daniel/Programming/servo/src/compiler/rust/src/libstd/condition.rs:131
...
```

This should now be fixed.
@bors-servo bors-servo closed this Dec 10, 2013
@bors-servo bors-servo merged commit 2d3fa10 into servo:master Dec 10, 2013
@SimonSapin
Copy link
Member

rust-lang/rust#10707 is relevant (but not blocking). I’d like to replace util::url with rust-url when the latter is ready.

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

Successfully merging this pull request may close these issues.

6 participants