Problem with special Characters in the URL
Thomas De Schampheleire
patrickdepinguin at gmail.com
Sat Aug 21 16:31:13 UTC 2021
Hi Rüdiger,
El jue, 19 ago 2021 a las 11:20, Rüdiger Kessel
(<r.kessel at metrodata.de>) escribió:
>
> Hi,
>
> I was faced with an URL encoding problem which caused a mercurial.error.ProgrammingError in mercurial/hgweb/request.py, line 276:
>
> "PATH_INFO does not begin with repo name"
>
> The root cause of the encoding problem is the fact that the wsgi encodes the URL in 'iso-8859-1' but it is in fact utf-8 encoded. It is connected with the use of Python 3.
>
> kallithea/controllers/base.py provides the function which can return the correct path info (get_path_info(environ)).
>
> So one solution is to patch the environ['PATH_INFO'] with the correct bytestring in BaseVCSController.__call__() using the following patch:
>
> --- a/kallithea/controllers/base.py Thu May 27 21:33:45 2021 +0200
> +++ b/kallithea/controllers/base.py Thu Aug 19 10:35:16 2021 +0200
> @@ -330,6 +330,7 @@
> log.info('%s action on %s repo "%s" by "%s" from %s',
> parsed_request.action, self.scm_alias, parsed_request.repo_name, user.username, ip_addr)
> app = self._make_app(parsed_request)
> + environ['PATH_INFO']=get_path_info(environ)
> return app(environ, start_response)
> except Exception:
> log.error(traceback.format_exc())
>
> I have only tested the patch using linux clients. So a test using Windows clients might be feasible.
Thanks for your report and potential fix.
Can you say more about the conditions in which you see a problem?
What version of Kallithea are you using?
How do you start Kallithea, which web server is used ?
How to reproduce this problem?
Thanks,
Thomas
More information about the kallithea-general
mailing list