Userland: Avoid some conversions from rvalue strings to StringView

These are all actually fine, there is no UAF here. But once e.g.
`ByteString::view() &&` is deleted, these instances won't compile.
This commit is contained in:
Timothy Flynn 2024-04-03 21:51:34 -04:00 committed by Andreas Kling
parent 23b25333a5
commit 683c08744a
Notes: sideshowbarker 2024-07-17 03:59:29 +09:00
17 changed files with 48 additions and 26 deletions

View file

@ -1337,7 +1337,8 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_network_or_cache_fet
// 11. If httpRequests referrer is a URL, then:
if (http_request->referrer().has<URL::URL>()) {
// 1. Let referrerValue be httpRequests referrer, serialized and isomorphic encoded.
auto referrer_value = TRY_OR_THROW_OOM(vm, ByteBuffer::copy(http_request->referrer().get<URL::URL>().serialize().bytes()));
auto referrer_string = http_request->referrer().get<URL::URL>().serialize();
auto referrer_value = TRY_OR_THROW_OOM(vm, ByteBuffer::copy(referrer_string.bytes()));
// 2. Append (`Referer`, referrerValue) to httpRequests header list.
auto header = Infrastructure::Header {