Skip to content

Commit

Permalink
Cherry-pick 260986@main (a7c8d72). https://bugs.webkit.org/show_bug.c…
Browse files Browse the repository at this point in the history
…gi?id=253128

    Lookalike characters should be removed from the request URL when deciding navigation policy
    https://bugs.webkit.org/show_bug.cgi?id=253128
    rdar://106061388

    Reviewed by Aditya Keerthi.

    Add some logic to adjust the request URL if needed, before proceeding with navigation (and calling
    out to the client layer).

    * Source/WebCore/loader/FrameLoader.cpp:
    (WebCore::FrameLoader::updateRequestAndAddExtraFields):

    Canonical link: https://commits.webkit.org/260986@main
  • Loading branch information
whsieh authored and aperezdc committed Apr 12, 2023
1 parent c583baa commit 790c977
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/WebCore/loader/FrameLoader.cpp
Expand Up @@ -3097,6 +3097,9 @@ void FrameLoader::updateRequestAndAddExtraFields(ResourceRequest& request, IsMai

if (shouldUpdate == ShouldUpdateAppInitiatedValue::Yes && localFrame->loader().documentLoader())
request.setIsAppInitiated(localFrame->loader().documentLoader()->lastNavigationWasAppInitiated());

if (page)
request.setURL(page->chrome().client().sanitizeLookalikeCharacters(request.url(), LookalikeCharacterSanitizationTrigger::Navigation));
}

void FrameLoader::scheduleRefreshIfNeeded(Document& document, const String& content, IsMetaRefresh isMetaRefresh)
Expand Down

0 comments on commit 790c977

Please sign in to comment.