Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: ef11a0fc671de16043e17c2c97af616d676cb809 https://github.com/WebKit/WebKit/commit/ef11a0fc671de16043e17c2c97af616d676cb809 Author: Sihui Liu <sihui_...@apple.com> Date: 2024-01-10 (Wed, 10 Jan 2024)
Changed paths: M Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp M Tools/TestWebKitAPI/Tests/WebKitCocoa/CreateWebArchive.mm Log Message: ----------- Escape characters when generating file name for saving web page resources https://bugs.webkit.org/show_bug.cgi?id=267286 rdar://120501555 Reviewed by Ryosuke Niwa and BJ Burg. In existing implementation, file names generated for saved web page resources could contain '%' or other characters that need to be encoded for URI. That means, when rewritting subresources URLs in the saved files, we have to encode file name properly. To avoid this trouble, this patch generates file names that only contains unreserved characters for URI (RFC 3986), which do not need to be percent-encoded in any case, and compatible with file system. Updated API test: WebArchive.SaveResourcesValidFileName * Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp: (WebCore::isUnreservedURICharacter): (WebCore::getFileNameFromURIComponent): (WebCore::generateValidFileName): * Tools/TestWebKitAPI/Tests/WebKitCocoa/CreateWebArchive.mm: Canonical link: https://commits.webkit.org/272880@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes