mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03:00
LaunchServer: Only consider path in OpenURL
This resolves the crash in #6812 where the browser was trying to open a file in the Download directory, but the check against allowed paths was also trying to match the URL fragment. Resolves #6812
This commit is contained in:
parent
b7fb12338c
commit
5b6f36dfea
Notes:
sideshowbarker
2024-07-18 18:46:41 +09:00
Author: https://github.com/vkoskiv Commit: https://github.com/SerenityOS/serenity/commit/5b6f36dfeab Pull-request: https://github.com/SerenityOS/serenity/pull/6817 Issue: https://github.com/SerenityOS/serenity/issues/6812
@ -36,9 +36,11 @@ Messages::LaunchServer::OpenURLResponse ClientConnection::handle(const Messages:
|
||||
{
|
||||
if (!m_allowlist.is_empty()) {
|
||||
bool allowed = false;
|
||||
auto request_url_without_fragment = request.url();
|
||||
request_url_without_fragment.set_fragment({});
|
||||
for (auto& allowed_handler : m_allowlist) {
|
||||
if (allowed_handler.handler_name == request.handler_name()
|
||||
&& (allowed_handler.any_url || allowed_handler.urls.contains_slow(request.url()))) {
|
||||
&& (allowed_handler.any_url || allowed_handler.urls.contains_slow(request_url_without_fragment))) {
|
||||
allowed = true;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user