Endpoint._make_request namespace detection guard misses text/xml responses

未关闭
#1,866 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
50/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
python
领域
api

调研方向

Start in tableauserverclient/server/endpoint/endpoint.py at Endpoint._make_request and compare its Content-Type guard with TSC’s XML_CONTENT_TYPE constant. Review #1046 and PR #1863 to determine whether namespace detection remains needed; done means the chosen path is covered for the relevant XML response type or the obsolete subsystem is removed consistently.

由索引模型根据 Issue 内容生成。

描述

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:

  1. 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.
  2. 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 #1046 and PR #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.

主要语言
Python
星标
716
派生
446
平均合并
8 天 8 小时
30 天内合并 PR
2

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

tableau/server-client-python 的其他 Issue

查看 tableau/server-client-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。