webrecorder / pywb

Core Python Web Archiving Toolkit for replay and recording of web archives
https://pypi.python.org/pypi/pywb
GNU General Public License v3.0
1.41k stars 217 forks source link

Fixes get_locale_prefixes() wrong paths #874

Closed Quirinus closed 1 year ago

Quirinus commented 1 year ago

If default_locale was set, and a web page was visited that doesn't have a langauge code in the path in the URL, the URL path parts returned by get_locale_prefixes() was wrong (e.g. /hrst/ instead of /hr/test/).

Description

I added checks that check if the collection part starts with the current locale or app_prefix before removing them.

Motivation and Context

I noticed the links for switching locales were wrong in the above described case.

Types of changes

Checklist:

No idea how to test.