comparison sat/plugins/plugin_comp_ap_gateway/__init__.py @ 3994:69d970f974ff

component AP gateway: don't percent-encode `@`: Mastodon doesn't like when "@" is percent-encoded (because it doesn't do it, and it checks that the URL matches the ID without taking care of percent-encoding).
author Goffi <goffi@goffi.org>
date Fri, 10 Feb 2023 17:20:02 +0100
parents 996e0f84935e
children b13673d998dc
comparison
equal deleted inserted replaced
3993:722c25818778 3994:69d970f974ff
836 @param type_: type of AP endpoing 836 @param type_: type of AP endpoing
837 @param arg: endpoint dependant arguments 837 @param arg: endpoint dependant arguments
838 """ 838 """
839 return parse.urljoin( 839 return parse.urljoin(
840 self.base_ap_url, 840 self.base_ap_url,
841 str(Path(type_).joinpath(*(parse.quote_plus(a) for a in args))) 841 str(Path(type_).joinpath(*(parse.quote_plus(a, safe="@") for a in args)))
842 ) 842 )
843 843
844 def isLocalURL(self, url: str) -> bool: 844 def isLocalURL(self, url: str) -> bool:
845 """Tells if an URL link to this component 845 """Tells if an URL link to this component
846 846