diff 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
line wrap: on
line diff
--- a/sat/plugins/plugin_comp_ap_gateway/http_server.py	Thu Nov 24 12:25:07 2022 +0100
+++ b/sat/plugins/plugin_comp_ap_gateway/http_server.py	Fri Nov 25 16:14:10 2022 +0100
@@ -942,7 +942,7 @@
             path
         )
         request_type, extra_args = self.apg.parseAPURL(ap_url)
-        if ((request.getHeader("accept") != MEDIA_TYPE_AP
+        if ((MEDIA_TYPE_AP in (request.getHeader("accept") or "")
              and request_type in self.apg.html_redirect)):
             # this is not a AP request, and we have a redirections for it
             kw = {}