mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Decode UTF-8 with from_utf8_lossy in DedicatedWorkerGlobalScope
This commit is contained in:
parent
83f687a7be
commit
9adda6e38d
2 changed files with 7 additions and 11 deletions
|
@ -173,7 +173,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
|
||||
let roots = RootCollection::new();
|
||||
let _stack_roots_tls = StackRootTLS::new(&roots);
|
||||
let (url, source) = match load_whole_resource(LoadContext::Script,
|
||||
let (metadata, bytes) = match load_whole_resource(LoadContext::Script,
|
||||
&init.resource_threads.sender(),
|
||||
worker_url,
|
||||
&worker_load_origin) {
|
||||
|
@ -183,10 +183,10 @@ impl DedicatedWorkerGlobalScope {
|
|||
box SimpleWorkerErrorHandler::new(worker))).unwrap();
|
||||
return;
|
||||
}
|
||||
Ok((metadata, bytes)) => {
|
||||
(metadata.final_url, String::from_utf8(bytes).unwrap())
|
||||
}
|
||||
Ok((metadata, bytes)) => (metadata, bytes)
|
||||
};
|
||||
let url = metadata.final_url;
|
||||
let source = String::from_utf8_lossy(&bytes);
|
||||
|
||||
let runtime = unsafe { new_rt_and_cx() };
|
||||
*worker_rt_for_mainthread.lock().unwrap() = Some(SharedRt::new(&runtime));
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
[004.worker]
|
||||
type: testharness
|
||||
bug: https://github.com/servo/servo/issues/13247
|
||||
expected: CRASH
|
Loading…
Add table
Add a link
Reference in a new issue