Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • gajim gajim
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Graph
    • Compare revisions
  • Issues 227
    • Issues 227
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 23
    • Merge requests 23
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • gajimgajim
  • gajimgajim
  • Issues
  • #10337

XEP-0363: Component requiring PUT HTTP headers causes an exception

Versions

  • OS: a custom Debian distribution
  • Gajim version: 1.2.1
  • GTK version: 3.24.20
  • Python-nbxmpp version: 1.0.1

Steps to reproduce the problem

  1. Try to upload a file.

  2. Have the XMPP component respond with a <put/> field containing a <header/>:

    <!-- Incoming Tue 03 Nov 2020 12:19:41 PM GMT (test@xmppdev.domain) -->
    <iq xmlns="jabber:client" to="test@xmppdev.domain/gajim.902EJ9AX" from="upload.xmppdev.domain" type="result" xml:lang="en" lang="en" id="afb37f0e-5e09-402f-8c0a-7975e5588026">
      <slot xmlns="urn:xmpp:http:upload:0">
        <put url="https://upload.xmppdev.domain/upload/e3f932b1-e62e-4f6a-9936-61ee520b7881/banana-dance.gif">
          <header name="Authorization">Bearer 123</header>
    </put>
        <get url="https://upload.xmppdev.domain/upload/e3f932b1-e62e-4f6a-9936-61ee520b7881/banana-dance.gif" />
    </slot>
    </iq>

    (I believe this is according to https://xmpp.org/extensions/xep-0363.html#example-6 -- but, I might be blind to a typo. Please let me know if I have a typo somewhere causing the exception.)

Expected behavior

Upload initiates and passes the Authorization header correctly.

Actual behavior

Upload is never starting in GUI.

image

No HTTP PUT request appears in logs for https://upload.xmppdev.domain.

Console in terminal displays an exception:

11/03/2020 12:26:22 (E) nbxmpp.dispatcher          (xmppdev.domain) Error while handling stanza
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nbxmpp/dispatcher.py", line 421, in dispatch
    func(self._client, stanza, **user_data)
  File "/usr/lib/python3/dist-packages/nbxmpp/util.py", line 121, in func_wrapper
    cb()(result, user_data)
  File "/usr/lib/python3/dist-packages/gajim/common/modules/httpupload.py", line 194, in _received_slot
    self._upload_file(transfer)
  File "/usr/lib/python3/dist-packages/gajim/common/modules/httpupload.py", line 211, in _upload_file
    for name, value in transfer.headers:
ValueError: too many values to unpack (expected 2)
Edited Nov 03, 2020 by Ivan Vučica
Assignee
Assign to
Time tracking