|
|
|
@ -14,6 +14,7 @@ import (
|
|
|
|
|
"path/filepath"
|
|
|
|
|
"regexp"
|
|
|
|
|
"strconv"
|
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
|
|
"github.com/beevik/etree" // BSD-2-clause
|
|
|
|
|
"github.com/gabriel-vasile/mimetype" // MIT License
|
|
|
|
@ -185,7 +186,9 @@ func httpUpload(client *xmpp.Client, iqc chan xmpp.IQ, jserver string, filePath
|
|
|
|
|
if iqHTTPUploadSlotXMLPutURL == nil {
|
|
|
|
|
log.Fatal("http-upload: no url attribute")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if !strings.HasPrefix(iqHTTPUploadSlotXMLPutURL.Value, "https://") {
|
|
|
|
|
log.Fatal("http-upload: upload slot does not provide https")
|
|
|
|
|
}
|
|
|
|
|
// Upload file
|
|
|
|
|
httpClient := &http.Client{}
|
|
|
|
|
req, err := http.NewRequest(http.MethodPut, iqHTTPUploadSlotXMLPutURL.Value,
|
|
|
|
|