Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP Upload disabled when max-file-size is unset #1241

Open
GigabyteProductions opened this issue May 29, 2021 · 0 comments
Open

HTTP Upload disabled when max-file-size is unset #1241

GigabyteProductions opened this issue May 29, 2021 · 0 comments

Comments

@GigabyteProductions
Copy link

The buttons to upload media disappear (like #868) when setting ejabberd's mod_http_upload's max_size to infinity.

The effect of setting max_size to infinity is that the max-file-size field is absent from the upload service discovery response.

XEP-0363 does not mandate the presence of max-file-size, and says "an entity SHOULD also include the maximum file size ... if such a limitation exists." I prefer not to impose the limitation on my private server.

Example query:

<iq from="[email protected]" id="query1" to="upload.gigabyteproductions.net" type="get">
  <query xmlns="http://jabber.org/protocol/disco#info"/>
</iq>

Response with max-file-size set (works with ChatSecure 5.0.3):

<iq lang="en" to="[email protected]/98045830788806205731282" from="upload.gigabyteproductions.net" type="result" id="query1">
  <query xmlns="http://jabber.org/protocol/disco#info">
    <identity name="HTTP File Upload" type="file" category="store"/>
    <feature var="urn:xmpp:http:upload"/>
    <feature var="urn:xmpp:http:upload:0"/>
    <feature var="eu:siacs:conversations:http:upload"/>
    <feature var="vcard-temp"/>
    <feature var="http://jabber.org/protocol/disco#info"/>
    <feature var="http://jabber.org/protocol/disco#items"/>
    <x xmlns="jabber:x:data" type="result">
      <field var="FORM_TYPE" type="hidden">
        <value>urn:xmpp:http:upload</value>
      </field>
      <field var="max-file-size" type="text-single" label="Maximum file size">
        <value>1099511627776</value>
      </field>
    </x>
    <x xmlns="jabber:x:data" type="result">
      <field var="FORM_TYPE" type="hidden">
        <value>urn:xmpp:http:upload:0</value>
      </field>
      <field var="max-file-size" type="text-single" label="Maximum file size">
        <value>1099511627776</value>
      </field>
    </x>
    <x xmlns="jabber:x:data" type="result">
      <field var="FORM_TYPE" type="hidden">
        <value>http://jabber.org/network/serverinfo</value>
      </field>
    </x>
  </query>
</iq>

Response without max-file-size set (does not work with ChatSecure 5.0.3):

<iq lang="en" to="[email protected]/98045830788806205731282" from="upload.gigabyteproductions.net" type="result" id="query2">
  <query xmlns="http://jabber.org/protocol/disco#info">
    <identity name="HTTP File Upload" type="file" category="store"/>
    <feature var="urn:xmpp:http:upload"/>
    <feature var="urn:xmpp:http:upload:0"/>
    <feature var="eu:siacs:conversations:http:upload"/>
    <feature var="vcard-temp"/>
    <feature var="http://jabber.org/protocol/disco#info"/>
    <feature var="http://jabber.org/protocol/disco#items"/>
    <x xmlns="jabber:x:data" type="result">
      <field var="FORM_TYPE" type="hidden">
        <value>http://jabber.org/network/serverinfo</value>
      </field>
    </x>
  </query>
</iq>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant