mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Implement view-source protocol. Fixes #4181.
This follows the recommendation from issue #4181. A handler for 'view-source' delegates to the HTTP loader. In that loader I check for view-source, adjust the URL to be the URL to be viewed and modify the Content-Type header to be text/plain. This doesn't actually result in the source being viewed as rendering text/plain is not yet implemented.
This commit is contained in:
parent
f5ddbcf19f
commit
82c52a7a1c
3 changed files with 34 additions and 3 deletions
|
@ -333,7 +333,7 @@ impl ResourceManager {
|
|||
|
||||
let loader = match load_data.url.scheme.as_slice() {
|
||||
"file" => from_factory(file_loader::factory),
|
||||
"http" | "https" => http_loader::factory(self.resource_task.clone()),
|
||||
"http" | "https" | "view-source" => http_loader::factory(self.resource_task.clone()),
|
||||
"data" => from_factory(data_loader::factory),
|
||||
"about" => from_factory(about_loader::factory),
|
||||
_ => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue