From 4e956f183dbb88f164103d37667d076986e8ac00 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Sun, 3 Sep 2023 10:51:41 +0200 Subject: [PATCH] HTML: correct URL encoding loading tests for windows-1251 It some point windows-1251 was added with an expected query of %26%23229%3B, but the loading tests were never changed to account for that query expectation. This makes them share the windows-1252 expectation which I suppose is not ideal, but unless there's a quick fix I'd prefer that to be follow-up material. Helps with #4934. --- .../resolving-urls/query-encoding/resources/resolve-url.js | 2 ++ .../urls/resolving-urls/query-encoding/resources/resource.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js b/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js index 35088a037230b2..0d68d615da1ecf 100644 --- a/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js +++ b/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js @@ -165,6 +165,7 @@ onload = function() { var query_to_image_width = { '%E5':1, + '%26%23229%3B':1, '%C3%A5':2, '%3F':16, 'unknown query':256, @@ -230,6 +231,7 @@ onload = function() { var query_to_video_duration = { '%E5':3, + '%26%23229%3B':3, '%C3%A5':5, '%3F':30, 'unknown query':300, diff --git a/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py b/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py index 60eb4a15a06cd4..0f898f3f230e15 100644 --- a/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py +++ b/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py @@ -105,7 +105,7 @@ def main(request, response): (u"""""" % isomorphic_decode(encoding)) .encode(isomorphic_decode(encoding))) elif type == b'png': - if q == u'%E5': + if q == u'%E5' or q == u'%26%23229%3B': image = u'green-1x1.png' elif q == u'%C3%A5': image = u'green-2x2.png' @@ -117,7 +117,7 @@ def main(request, response): return [(b"Content-Type", b"image/png")], rv elif type == b'video': ext = request.GET[b'ext'] - if q == u'%E5': + if q == u'%E5' or q == u'%26%23229%3B': video = u'A4' # duration: 3 elif q == u'%C3%A5': video = u'movie_5' # duration: 5