Endpoint._make_request (in tableauserverclient/server/endpoint/endpoint.py) parses the response Content-Type and calls the namespace-detection helper only when it matches:
if content_type == "application/xml":
self.parent_srv._namespace.detect(server_response.content)
Tableau Server emits text/xml (which is what TSC's own XML_CONTENT_TYPE constant is set to), so _namespace.detect() never fires from this path. The pre-existing sign-in path called _namespace.detect() explicitly, so the pre-8.3 namespace fallback still worked there; PR #1848 routes signin through _make_request, which now exposes the bug for signin traffic too.
Two things worth thinking about together:
- The immediate fix: widen the guard to accept both application/xml and text/xml, or (cheaper) just check "xml" in content_type since detection is idempotent and cheap.
- Is the code even reachable? The namespace fallback exists to accept pre-Tableau-8.3 servers that used http://tableausoftware.com/api instead of http://tableau.com/api. TSC's minimum_supported_server_version is 2.3, which corresponds to Tableau Server 10.0 (2016). Any server old enough to emit the pre-8.3 namespace is far below the minimum. See Stop supporting old namespaces #1046 and PR Proposed: Remove pre-8.3 XML namespace fallback #1863 for a proposed removal of the whole detection subsystem.
If PR #1863 lands, this issue is moot (the whole _namespace.detect call and the Namespace class go away). If it doesn't, we need to fix the guard.
Filed after a fresh-eyes review flagged the guard on PR #1848.
Reactions are currently unavailable
Endpoint._make_request (in tableauserverclient/server/endpoint/endpoint.py) parses the response Content-Type and calls the namespace-detection helper only when it matches:
Tableau Server emits text/xml (which is what TSC's own XML_CONTENT_TYPE constant is set to), so _namespace.detect() never fires from this path. The pre-existing sign-in path called _namespace.detect() explicitly, so the pre-8.3 namespace fallback still worked there; PR #1848 routes signin through _make_request, which now exposes the bug for signin traffic too.
Two things worth thinking about together:
If PR #1863 lands, this issue is moot (the whole _namespace.detect call and the Namespace class go away). If it doesn't, we need to fix the guard.
Filed after a fresh-eyes review flagged the guard on PR #1848.