Kaynağa Gözat

Remove additional slash in /feed/ redirect

pull/475/head
Matt Baer 2 yıl önce
ebeveyn
işleme
e91ffe2dcb
2 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. +2
    -0
      collections.go
  2. +1
    -1
      posts.go

+ 2
- 0
collections.go Dosyayı Görüntüle

@@ -242,6 +242,8 @@ func (c *Collection) DisplayCanonicalURL() string {
return d + p
}

// RedirectingCanonicalURL returns the fully-qualified canonical URL for the Collection, with a trailing slash. The
// hostName field needs to be populated for this to work correctly.
func (c *Collection) RedirectingCanonicalURL(isRedir bool) string {
if c.hostName == "" {
// If this is true, the human programmers screwed up. So ask for a bug report and fail, fail, fail


+ 1
- 1
posts.go Dosyayı Görüntüle

@@ -1461,7 +1461,7 @@ func viewCollectionPost(app *App, w http.ResponseWriter, r *http.Request) error
if slug == "feed" {
// User tried to access blog feed without a trailing slash, and
// there's no post with a slug "feed"
return impart.HTTPError{http.StatusFound, c.CanonicalURL() + "/feed/"}
return impart.HTTPError{http.StatusFound, c.CanonicalURL() + "feed/"}
}

po := &Post{


Yükleniyor…
İptal
Kaydet