Commit graph

1467 commits

Author SHA1 Message Date
Michael Howell
b8f3e8bb2e Add simple implementation of content-security-policy on scripts / styles
This needs a lot more hooks before it'll actually be a good
implementation, but for a start it can help get some feedback on if this
is the right way to go about it.

Part of servo/servo#4577
2019-10-16 19:46:45 +00:00
bors-servo
d28d9fe273
Auto merge of #23990 - tomasdivito:add-secure-connection-start, r=jdm
Add secure connection start

Implementing `secure_connection_start` as well as we can, this is related to #21268

We are setting the value as well as we can since we don't have a way to know if we are currently using a secure transport or where the handshake before the connection is done as the spec says on the step 15 [https://w3c.github.io/resource-timing/#sec-process](https://w3c.github.io/resource-timing/#sec-process)

Regarding the Timing Allow Check, that's being done on another PR by another person which will take care of setting the rest of the values on `PerformaceResourceTiming` to Zero and prevent them to set them any other way.

I'm currently setting the `secure_connection_time` using `precise_time_ms()` as the `connection_start` and `connection_end` are set that way... but other attributes inside `PerformanceResourceTiming` are set using `precise_time

Another thing, the issue talks about setting `redirect_start` but I'm not really sure if it's related, if so I can look up into that too... I might have just read and thought it was all about secure connection start.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #21268

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23990)
<!-- Reviewable:end -->
2019-10-10 22:16:27 -04:00
Tomas Di Vito
bd0c0b65ba implemented secure_connection_start 2019-10-10 14:30:03 -03:00
bors-servo
b34fc13eee
Auto merge of #24401 - gterzian:ensure_done_chan_is_none_when_revalidating, r=jdm
Fetch: ensure consistency between response, done-chan, and cache state.

This ensures that when a cached response is not used because it requires revalidation, the done chan is set back to `None`(since the cache might have set it to `Some` when constructing the response requiring revalidation).

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #24399 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24401)
<!-- Reviewable:end -->
2019-10-09 10:53:17 -04:00
bors-servo
3d529b1b88
Auto merge of #24402 - gterzian:remove_thread_spawning_in_ws, r=jdm
Websocket: use ipc router to handle ws dom-action messages

<!-- Please describe your changes on the following line: -->

Use the ipc router as opposed to spawning a dedicated thread.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24402)
<!-- Reviewable:end -->
2019-10-09 09:16:12 -04:00
Gregory Terzian
c1573cc4fc use ipc router to handle ws dom-action messages 2019-10-09 17:36:45 +08:00
Gregory Terzian
bb1fa88864 fetch: ensure consistency between response, done-chan, and cache state. 2019-10-09 17:13:03 +08:00
CYBAI
f771e5f371 Use RequestBuilder for CORS preflight fetch 2019-10-09 12:23:43 +09:00
Gregory Terzian
4f3ba70704 http-cache: wait on pending stores
and various small improvements
2019-10-08 17:58:20 +08:00
bors-servo
75548f40c6
Auto merge of #24340 - jdm:image-cache-cors, r=Manishearth
Allow using CORS filtered image responses as WebGL textures

More specifically, this makes the "is this image same origin?" check consider the CORS status of the original response, rather than relying on an overly-strict "is this image's response's URL same-origin with a particular global?" check. To do this, we make the image cache double keyed based on the requested URL as well as the requesting origin, and store the CORS status of the eventual response with the final image that eventually gets sent to the HTMLImageElement consumer.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24330 and fix #24368
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24340)
<!-- Reviewable:end -->
2019-10-07 18:39:36 -04:00
bors-servo
37ab273c82
Auto merge of #24370 - jdm:cache-crossorigin-test, r=gterzian
Cache crossorigin test

This adds a test for #24356 to ensure that we don't regress our cache behaviour.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24370)
<!-- Reviewable:end -->
2019-10-07 11:28:53 -04:00
Tugdual JULLIEN
85e6418271 Pass argument by reference to CacheKey constructor
Argument now passed by reference, and clone() removed when calling
constructor.
2019-10-05 11:18:51 +02:00
Josh Matthews
b347cf877c Add some useful HTTP cache debug output. 2019-10-04 15:26:03 -04:00
Josh Matthews
a241232c2b Add useful debug output for HTTP response and image cache. 2019-10-04 15:08:40 -04:00
Josh Matthews
1df8d57dc6 Support CORS attributes for image elements. 2019-10-04 15:08:40 -04:00
Josh Matthews
81a67aed9e Double key image cache by requesting origin, and store CORS status with cached images. 2019-10-04 09:22:21 -04:00
Josh Matthews
2156ed7ab2
rustfmt 2019-10-03 03:12:18 -04:00
Josh Matthews
d8cdc71a28
Use unfiltered response body when replicating body of cached responses. 2019-10-03 02:21:27 -04:00
Shotaro Yamada
b228d2700e Remove unused dependencies 2019-10-01 21:15:53 +09:00
Javed Nissar
7596c36959 Move ResourceFetchTiming into Arc
The purpose of this commit is to ensure that the Response object has
access to Timing updates as previously the Response object simply
stored a ResourceFetchTiming struct so updates on ResourceFetchTiming
that were not explicitly done on the Response would not be passed down.
The references to ServoArc are added because Response uses
servo_arc::Arc rather than std::sync::Arc as is used elsewhere. So,
we've switched those other places to servo_arc::Arc instead of switching
Response to std::sync::Arc.
2019-09-18 11:54:28 -04:00
Javed Nissar
bb8166bb97 Add PerformanceResourceTiming: TimingAllowCheck
The purpose of this commit is to implement https://w3c.github.io/resource-timing/#dfn-timing-allow-check
2019-09-18 11:54:28 -04:00
Alan Jeffrey
49a5e84fb1 Responding to review comments 2019-09-11 11:40:50 -05:00
Alan Jeffrey
aeac382058 Make http_loader more robust against hyperium parse errors 2019-09-10 16:13:50 -05:00
Alan Jeffrey
1aeb97b281 Prefetch img and scripts during parsing 2019-09-10 16:13:49 -05:00
Josh Matthews
0d88b04f32 Update hyper to 0.12.33. 2019-08-29 14:51:01 -07:00
Bastien Orivel
92161ecfbc Update ipc-channel and related dependencies 2019-08-27 23:44:04 +02:00
Simon Sapin
8eb650bafd Deduplicate idna, log, mime, mime_guess, percent-encoding, unicase, url, ws 2019-08-19 20:09:20 +02:00
Simon Sapin
734fa6da2b Update to percent-encoding 2.0 2019-08-17 10:03:44 +02:00
Simon Sapin
9392180007 Update to url 2.0 2019-08-17 10:03:44 +02:00
Alan Jeffrey
701256d837 Pass the event loop waker into WebXR 2019-07-25 12:55:26 -05:00
Thomas Delacour
18178fa107
ISSUE-21257: set redirectEnd on PerformanceResourceTiming 2019-07-19 21:36:24 +02:00
Patrick Walton
2f9c9cefdb WebRender units are no longer reexported. 2019-07-09 10:50:27 -04:00
Kamil Niski
d84513cc50 Add PerformanceResourceTiming: domainLookupStart
Remove wpt tests for domainLookupStart

Set ResourceAttribute::DomainLookupTime

Move DomainLookupStart timing before HTTP request initialization

Change label of domainLookupStart TAO zero test to PASS

Adjust the from_resource_timing method to initialize domain_lookup_start value

Restore domainLookupsStart test
2019-06-30 00:20:26 +02:00
bors-servo
1d2c0ba0bc
Auto merge of #23593 - georgeroman:fix_panic_on_opening_directory, r=Manishearth
Fix panic on opening a directory

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

Continued from https://github.com/servo/servo/pull/23548

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23593)
<!-- Reviewable:end -->
2019-06-22 22:24:08 -04:00
bors-servo
5592682c4b
Auto merge of #23494 - gterzian:improve_http_cache, r=jdm
Various improvements and update to the http cache

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23494)
<!-- Reviewable:end -->
2019-06-22 11:36:14 -04:00
Gregory Terzian
689b7971b8 http-cache: re-enable and update test 2019-06-22 06:28:32 -07:00
Simon Sapin
1d38bc0419 Fix some new warnings 2019-06-22 14:59:09 +02:00
Gregory Terzian
67494d4776 http-cache: do not cache responses from requests with authorization 2019-06-20 06:18:25 -07:00
Gregory Terzian
049817c5a7 http-cache: remove double-store of resources 2019-06-19 05:25:32 -07:00
George Roman
29bdcba1e8 Fix panic on opening a directory 2019-06-18 17:01:51 +03:00
Gregory Terzian
4f41065dfb http-cache: improve handling of network errors and partial content 2019-06-17 13:19:46 +08:00
Josh Matthews
b1510d9ad5 Upgrade headers, headers-core, and hyper_serde. 2019-06-13 11:08:16 -04:00
Josh Matthews
09f7b6bf36 Upgrade ws. 2019-06-12 15:01:03 -04:00
oneturkmen
9034fb64b7 Net: removed opts::get() usage 2019-06-06 18:48:17 -06:00
est31
fe58aca75d Remove unused code from net and net_traits crates 2019-06-02 02:44:37 +02:00
bors-servo
208d6cb99e
Auto merge of #23323 - nehalem501:master, r=jdm
Implement connectStart in PerformanceResourceTiming

<!-- Please describe your changes on the following line: -->
- Added connectStart where needed (```ResourceFetchTiming```, ```ResourceAttribute```) in ```components/net_traits/lib.rs ```
- Before calling ```client.request``` in ```obtain_response```, we now add the ```connectStart``` attribute (```components/net/http_loader.rs```)
- Updated tests to reflect those changes

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [X] These changes fix #21261 (at least partially)

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23323)
<!-- Reviewable:end -->
2019-05-17 18:10:09 -04:00
Jan Andre Ikenmeyer
25333b6451
Disable TLS 1.0 and 1.1 2019-05-10 14:53:32 +02:00
Tomek LECOCQ
a11684460d Add connectStart in PerformanceResourceTiming 2019-05-03 21:47:00 +02:00
bors-servo
b73956cc37
Auto merge of #23090 - miller-time:nav-fetch-referrer, r=gterzian
Add referrer to navigation fetch request

<!-- Please describe your changes on the following line: -->
Implement step 13 of [following hyperlinks](https://html.spec.whatwg.org/#following-hyperlinks-2) and step 14.3 of [window open](https://html.spec.whatwg.org/#window-open-steps), as well as other referrer- and fetch-related updates.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22890 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23090)
<!-- Reviewable:end -->
2019-04-25 20:21:23 -04:00
Thomas Delacour
fdbec9835c ISSUE-21263: implemented attribute setting in http loader 2019-04-23 12:33:28 -04:00