Mercurial > libervia-backend
comparison sat/plugins/plugin_comp_ap_gateway/http_server.py @ 3991:cd0943ceb326
component AP gateway: fix header checking for redirection
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 25 Nov 2022 16:14:10 +0100 |
parents | 31c3d6652115 |
children | 1c84268752a1 |
comparison
equal
deleted
inserted
replaced
3990:3b72743b92db | 3991:cd0943ceb326 |
---|---|
940 ap_url = parse.urljoin( | 940 ap_url = parse.urljoin( |
941 f"https://{self.apg.public_url}", | 941 f"https://{self.apg.public_url}", |
942 path | 942 path |
943 ) | 943 ) |
944 request_type, extra_args = self.apg.parseAPURL(ap_url) | 944 request_type, extra_args = self.apg.parseAPURL(ap_url) |
945 if ((request.getHeader("accept") != MEDIA_TYPE_AP | 945 if ((MEDIA_TYPE_AP in (request.getHeader("accept") or "") |
946 and request_type in self.apg.html_redirect)): | 946 and request_type in self.apg.html_redirect)): |
947 # this is not a AP request, and we have a redirections for it | 947 # this is not a AP request, and we have a redirections for it |
948 kw = {} | 948 kw = {} |
949 if extra_args: | 949 if extra_args: |
950 kw["jid"], kw["node"] = await self.apg.getJIDAndNode(extra_args[0]) | 950 kw["jid"], kw["node"] = await self.apg.getJIDAndNode(extra_args[0]) |