bors-servo
1071c3339f
Auto merge of #16126 - ferjm:issue-14520-block-media-csv, r=nox
...
Block scripts with text/csv, audio/*, video/* and image/* mime types
This patch implements step 12 of the Main Fetch section of the Fetch API standard. It blocks the load of scripts with `text/csv`, `audio/*`, `video/*` and `image/*` mime types.
Credit for the logic of `should_block_mime_type` function should go to the author of #14770 .
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14520
- [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/16126 )
<!-- Reviewable:end -->
2017-04-05 02:34:27 -05:00
Anthony Ramine
a600a60a09
Use set_default_accept in websocket_loader
2017-04-04 13:17:19 +02:00
Anthony Ramine
901877da1a
Introduce http_loader::set_default_accept
2017-04-04 13:17:18 +02:00
Anthony Ramine
4281205662
Update the steps in fetch_with_cors_cache
2017-04-04 13:17:17 +02:00
Anthony Ramine
053aaedb52
Properly set Accept-Language in websocket_loader
2017-04-04 12:53:08 +02:00
Anthony Ramine
fbd42bb4f8
Use cookie::from_cookie_string in websocket_loader
2017-04-04 12:50:25 +02:00
Anthony Ramine
3485c8371e
Pass http_state around in websocket_loader
2017-04-03 23:54:25 +02:00
Fernando Jiménez Moreno
29a56c4d1a
Block scripts with text/csv, audio/*, video/* and image/* mime types
2017-04-03 18:25:15 +02:00
Anthony Ramine
1e91442d98
Don't share the SSL client between the private and public groups
2017-04-03 17:37:37 +02:00
Anthony Ramine
64ba597a3a
Move Arc out of HttpState
2017-04-03 14:00:36 +02:00
Anthony Ramine
8683f4d43e
Reuse HttpState in ResourceGroup
2017-04-03 12:47:35 +02:00
Anthony Ramine
016fee016b
Move the HTTP connector to FetchContext
2017-04-03 12:47:33 +02:00
Anthony Ramine
7b16021a89
Make Response::url_list be a bare Vec<ServoUrl>
2017-04-03 12:47:28 +02:00
Anthony Ramine
28f1f669bc
Update steps of main_fetch according to the Fetch spec
2017-04-03 12:39:13 +02:00
Anthony Ramine
80e02303d3
Make Response::internal_response a bare boolean
2017-04-03 12:39:11 +02:00
Anthony Ramine
cb2eb81208
Remove all internal mutability from Request
2017-04-03 12:39:07 +02:00
Anthony Ramine
f42a63baea
Make fetch take a &Request
2017-04-03 12:33:43 +02:00
Anthony Ramine
9601a66b60
Make cors_preflight_fetch take a &Request
2017-04-03 11:09:39 +02:00
Anthony Ramine
d5cbdffe37
Make cors_check take a &Request
2017-04-03 11:09:38 +02:00
Anthony Ramine
20e0b6cd56
Introduce create_ssl_client
...
This lets us reuse the same SSL context for all HTTPS requests.
2017-04-02 15:27:40 +02:00
Anthony Ramine
ecd9ac9b68
Reorder and reorganise imports in net::connector
2017-04-02 14:57:19 +02:00
Josh Matthews
30fad4ea9d
Revert "Enable HTTP pooling again ( fixes #15694 )".
2017-04-01 10:26:51 -04:00
Anthony Ramine
1ff2bebdd7
Enable HTTP pooling again ( fixes #15694 )
2017-03-31 23:09:51 +02:00
ddh
e527c9a991
Update Hyper and OpenSSL
2017-03-31 16:32:21 +02:00
Anthony Ramine
f66cae3f96
Revert "Introduce create_ssl_context"
...
This reverts commit 7a4632bfa2
.
2017-03-31 16:19:00 +02:00
Anthony Ramine
857958f516
Revert "Store SSL context in ResourceGroup"
...
This reverts commit 02b2aa159a
.
2017-03-31 16:18:59 +02:00
Anthony Ramine
19a2516e10
Disable wss support
...
None of the existing websocket libraries are currently able to cope
with openssl 0.9 and be featureful, so we are disabling wss for now
to land openssl 0.9.
2017-03-31 16:18:47 +02:00
bors-servo
0f9dbcc808
Auto merge of #16156 - ferjm:issue-16130-http-network-or-cache-fetch, r=jdm
...
Update http_network_or_cache_fetch according to spec
There are still many steps blocked by the absence of an HTTP cache and the inability to trigger a credentials dialog.
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #16130
<!-- 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/16156 )
<!-- Reviewable:end -->
2017-03-29 19:38:45 -05:00
Anthony Ramine
d022535f9c
Make the WebSocket handshake ourselves to ease switching libs
...
We need to switch to tungstenite to finally update openssl, this commit
rewrites the whole websocket infrastructure to properly follow the Fetch
spec and to make switching to a different websocket library easier.
2017-03-29 19:17:27 +02:00
Anthony Ramine
3ed32f8078
Introduce NetworkError::from_hyper_error and from_ssl_error
2017-03-29 18:01:01 +02:00
bors-servo
299f9446e6
Auto merge of #16160 - nox:tungstenite, r=jdm
...
Some enhancements in the net crate
See the individual commits.
<!-- 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/16160 )
<!-- Reviewable:end -->
2017-03-29 03:33:53 -05:00
Anthony Ramine
02b2aa159a
Store SSL context in ResourceGroup
...
This allows sharing it with the HTTP state in CoreResourceManager::fetch.
2017-03-28 00:52:10 +02:00
Anthony Ramine
7a4632bfa2
Introduce create_ssl_context
2017-03-28 00:37:25 +02:00
Fernando Jiménez Moreno
fa433a74b1
Remove useless ImageDecoderRunnable struct
2017-03-27 20:44:04 +02:00
Fernando Jiménez Moreno
f4da16566d
Make ImageCacheImpl have a single Mutex<ImageCacheStore> and use ImageDecoderRunnable
2017-03-27 19:54:15 +02:00
Fernando Jiménez Moreno
166c4e8bb2
Move image cache implementation to the net crate
2017-03-27 19:54:15 +02:00
Fernando Jiménez Moreno
72d7ee613b
Make image cache per-document rather than global
2017-03-27 19:54:13 +02:00
Fernando Jiménez Moreno
d919f55884
Update http_network_or_cache_fetch according to spec
2017-03-27 19:45:05 +02:00
Anthony Ramine
e2e2d42e38
Introduce http_loader::is_redirect_status
2017-03-27 14:51:10 +02:00
Anthony Ramine
d64aa9c5bf
Simplify should_be_blocked_due_to_nosniff
2017-03-27 14:14:34 +02:00
bors-servo
d992442dc6
Auto merge of #16137 - nox:die-rustc-serialize-die, r=emilio
...
Replace use of rustc_serialize::base64 by base64
<!-- 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/16137 )
<!-- Reviewable:end -->
2017-03-26 12:23:17 -07:00
Anthony Ramine
8796a82b9f
Put websocket_loader::init first in its module
2017-03-26 16:15:12 +02:00
Anthony Ramine
b096bf4806
Use Url::port instead of Url::port_or_known_default to set Host
...
AFAIK, if there is no explicit port in the request URL, there should be
no explicit port in the Host header.
2017-03-26 16:15:10 +02:00
Anthony Ramine
92c4a43946
Use NetworkConnector directly to account for replaced hosts
...
This let us remove a hack where we had to replace the host in the request URL.
2017-03-26 16:15:09 +02:00
Anthony Ramine
54d37d920c
Remove some useless Option<T> wrappers from ServoUrl methods
2017-03-26 16:15:06 +02:00
Anthony Ramine
bc5c4fa892
Rework replace_hosts and host_replacement
...
They do less cloning now.
2017-03-26 16:14:22 +02:00
Anthony Ramine
0ed4df28b5
Replace use of rustc_serialize::base64 by base64
2017-03-26 14:15:31 +02:00
Anthony Ramine
28e4252a05
Remove some useless thread spawning in websocket_loader
2017-03-24 12:46:38 +01:00
Anthony Ramine
a6d22b1a35
Only pass the protocol in use in to establish a WS connection
2017-03-24 11:09:30 +01:00
Anthony Ramine
0bd54b904b
Properly follow the spec in WebSocket::Constructor
2017-03-24 09:43:14 +01:00