Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
gajim
gajim
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 196
    • Issues 196
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 21
    • Merge Requests 21
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • gajim
  • gajimgajim
  • Issues
  • #10337

Closed
Open
Opened Nov 03, 2020 by Ivan Vučica@ivucica

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
1.3.0
Milestone
1.3.0
Assign milestone
Time tracking
None
Due date
None
Reference: gajim/gajim#10337