guusdk / httpfileuploadcomponent

A XMPP External Component that implements XEP-0363 'HTTP File Upload'.
Apache License 2.0
8 stars 10 forks source link

Getting port as part of upload and download uri #45

Closed shreekantha closed 10 months ago

shreekantha commented 10 months ago

When I request a solt to upload the file, its returning slot download and upload uri with port. I have done proxy-path config for those ports because I dont want to expose those ports to public, But getSlot method returning with ports.

Please see the response object below

{ "type": "slot", "download": "https://communicationqa.dhi-edu.com:7443/httpfileupload/ZmbOvMB8HQI5Bjfzp1W5MzFmQ0Y/018902.pdf", "upload": { "url": "https://communicationqa.dhi-edu.com:7443/httpfileupload/ZmbOvMB8HQI5Bjfzp1W5MzFmQ0Y/018902.pdf" } }

Please help how to avoid ports as part of download and upload uri

guusdk commented 10 months ago

There will always be a port in the URL. You can change the value of the port with the property announcedWebPort.

shreekantha commented 10 months ago

Thanks for your quick response.

We don't want to make port public, so we used proxy-pass for those ports. Is there any option to exclude port in getSlot responses of upload and download url

guusdk commented 10 months ago

Even if you use a proxy, you will always be using a port. If an URL does not explicitly name a port, the default port is used (port 80 for http, or 443 of https).

I do not believe that this component can be configured to remove the port definition from the announced URL - but you can make it equal to a default, so that it works with your proxy.