|
|
|
@ -79,12 +79,12 @@ func httpUpload(client *xmpp.Client, jserver string, filePath string) string {
|
|
|
|
|
URL string `xml:"url,attr"`
|
|
|
|
|
} `xml:"get"`
|
|
|
|
|
Put struct {
|
|
|
|
|
Text string `xml:",chardata"`
|
|
|
|
|
URL string `xml:"url,attr"`
|
|
|
|
|
Headers []struct {
|
|
|
|
|
Name string `xml:"name,attr"`
|
|
|
|
|
Value string `xml:",chardata"`
|
|
|
|
|
} `xml:"header"`
|
|
|
|
|
Text string `xml:",chardata"`
|
|
|
|
|
URL string `xml:"url,attr"`
|
|
|
|
|
Headers []struct {
|
|
|
|
|
Name string `xml:"name,attr"`
|
|
|
|
|
Value string `xml:",chardata"`
|
|
|
|
|
} `xml:"header"`
|
|
|
|
|
} `xml:"put"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -217,12 +217,12 @@ func httpUpload(client *xmpp.Client, jserver string, filePath string) string {
|
|
|
|
|
log.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
req.Header.Set("Content-Type", mimeType)
|
|
|
|
|
for _, h := range iqHttpUploadSlotXML.Put.Headers {
|
|
|
|
|
switch h.Name {
|
|
|
|
|
case "Authorization", "Cookie", "Expires":
|
|
|
|
|
req.Header.Set(h.Name, h.Value)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for _, h := range iqHttpUploadSlotXML.Put.Headers {
|
|
|
|
|
switch h.Name {
|
|
|
|
|
case "Authorization", "Cookie", "Expires":
|
|
|
|
|
req.Header.Set(h.Name, h.Value)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
resp, err := httpClient.Do(req)
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Fatal(err)
|
|
|
|
|