Added CROS for RSS
Cette révision appartient à :
Parent
b2c1ac13b4
révision
4d5c04bbac
1 fichiers modifiés avec 3 ajouts et 2 suppressions
|
@ -36,12 +36,13 @@ func RSSHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
Id: "https://" + config.WebAddress + "/view/" + strconv.FormatUint(uint64(torrents[i].ID), 10),
|
Id: "https://" + config.WebAddress + "/view/" + strconv.FormatUint(uint64(torrents[i].ID), 10),
|
||||||
Title: torrents[i].Name,
|
Title: torrents[i].Name,
|
||||||
Link: &feeds.Link{Href: string(torrentJSON.Magnet)},
|
Link: &feeds.Link{Href: string(torrentJSON.Magnet)},
|
||||||
Description: "",
|
Description: string(torrentJSON.Description),
|
||||||
Created: torrents[0].Date,
|
Created: torrents[0].Date,
|
||||||
Updated: torrents[0].Date,
|
Updated: torrents[0].Date,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//allow cross domain AJAX requests
|
||||||
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
rss, rssErr := feed.ToRss()
|
rss, rssErr := feed.ToRss()
|
||||||
if rssErr != nil {
|
if rssErr != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
|
|
Référencer dans un nouveau ticket