Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Remove hardcoded URLs

Cette révision appartient à :
sfan5 2017-05-07 15:19:36 +02:00
Parent 4814fff3dc
révision a201d0d058
2 fichiers modifiés avec 5 ajouts et 3 suppressions

Voir le fichier

@ -4,6 +4,7 @@ import(
"time" "time"
"net/http" "net/http"
"github.com/gorilla/feeds" "github.com/gorilla/feeds"
"github.com/ewhal/nyaa/config"
"github.com/ewhal/nyaa/util/search" "github.com/ewhal/nyaa/util/search"
"strconv" "strconv"
) )
@ -18,7 +19,7 @@ func RssHandler(w http.ResponseWriter, r *http.Request) {
} }
feed := &feeds.Feed{ feed := &feeds.Feed{
Title: "Nyaa Pantsu", Title: "Nyaa Pantsu",
Link: &feeds.Link{Href: "https://nyaa.pantsu.cat/"}, Link: &feeds.Link{Href: "https://" + config.WebAddress + "/"},
Created: created_as_time, Created: created_as_time,
} }
feed.Items = []*feeds.Item{} feed.Items = []*feeds.Item{}
@ -44,4 +45,4 @@ func RssHandler(w http.ResponseWriter, r *http.Request) {
} else { } else {
http.Error(w, err.Error(), http.StatusInternalServerError) http.Error(w, err.Error(), http.StatusInternalServerError)
} }
} }

Voir le fichier

@ -9,6 +9,7 @@ import (
"strings" "strings"
"regexp" "regexp"
"github.com/ewhal/nyaa/config"
"github.com/ewhal/nyaa/service/captcha" "github.com/ewhal/nyaa/service/captcha"
"github.com/ewhal/nyaa/util" "github.com/ewhal/nyaa/util"
"github.com/ewhal/nyaa/util/metainfo" "github.com/ewhal/nyaa/util/metainfo"
@ -56,7 +57,7 @@ var ErrPrivateTorrent = errors.New("torrent is private")
// error indicating a problem with its trackers // error indicating a problem with its trackers
// FIXME: hardcoded link // FIXME: hardcoded link
var ErrTrackerProblem = errors.New("torrent does not have any (working) trackers: https://nyaa.pantsu.cat/faq#trackers") var ErrTrackerProblem = errors.New("torrent does not have any (working) trackers: https://" + config.WebAddress + "/faq#trackers")
// error indicating a torrent's name is invalid // error indicating a torrent's name is invalid
var ErrInvalidTorrentName = errors.New("torrent name is invalid") var ErrInvalidTorrentName = errors.New("torrent name is invalid")