Endpoint._make_request namespace detection guard misses text/xml responses

Aperta
#1,866 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
50/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
api

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
716
Fork
446
Merge medio
8g 8h
PR unite (30g)
2

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tableau/server-client-python

Tutte le issue di tableau/server-client-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.