File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -175,12 +175,17 @@ Async::_Task<Rc<Font::Database>> _loadFontfacesAsync(Http::Client& client, Style
175175static auto dumpDom = Debug::Flag::debug(" web-dom" , " Dump the loaded DOM tree" );
176176static auto dumpStylesheets = Debug::Flag::debug(" web-stylesheets" , " Dump the loaded stylesheets" );
177177
178- static Str ABOUT_BLANK = R"html( <!DOCTYPE html><html><head></head><body></body></html>)html" ;
179-
178+ // https://fetch.spec.whatwg.org/#scheme-fetch
180179export Async::Task<Gc::Ref<Dom::Document>> fetchDocumentAsync (Gc::Heap& heap, Http::Client& client, Ref::Url const & url) {
181180 Ref::Url resolvedUrl = url;
182- if (url.scheme == " about" and url.path .str () == " blank" )
183- resolvedUrl = Ref::Url::data (" text/html" _mime, bytes (ABOUT_BLANK));
181+
182+ // If request’s current URL’s path is the string "blank",
183+ if (url.scheme == " about" and url.path .str () == " blank" ) {
184+ // then return a new response whose status message is `OK`,
185+ // header list is « (`Content-Type`, `text/html;charset=utf-8`) »
186+ // and body is the empty byte sequence as a body.
187+ resolvedUrl = Ref::Url::data (" text/html" _mime, {});
188+ }
184189
185190 auto resp = co_trya$(client.getAsync (resolvedUrl));
186191 auto dom = co_trya$(_loadDocumentAsync (heap, url, resp));
You can’t perform that action at this time.
0 commit comments