Delete unnecessary http:// from articles.go and issues.go
This commit is contained in:
parent
4663cedec5
commit
cd67fe6df3
@ -94,7 +94,7 @@ func SubmitArticle(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
article.Link = fmt.Sprint("http://", c.Domain, c.Port, "/article/serve/", article.ID)
|
||||
article.Link = fmt.Sprint(c.Domain, c.Port, "/article/serve/", article.ID)
|
||||
if err = db.UpdateAttributes(&b.Attribute{Table: "articles", ID: article.ID, AttName: "link", Value: article.Link}); err != nil {
|
||||
log.Println(err)
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
|
@ -60,7 +60,7 @@ func PublishLatestIssue(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFun
|
||||
|
||||
article := &b.Article{
|
||||
Title: "Autogenerated cpolis Issue Article",
|
||||
EncURL: fmt.Sprint("http://", c.Domain, c.Port, "/image/serve/", imgFileName),
|
||||
EncURL: fmt.Sprint(c.Domain, c.Port, "/image/serve/", imgFileName),
|
||||
EncLength: int(imgSize),
|
||||
EncType: mimeType,
|
||||
Published: true,
|
||||
@ -84,7 +84,7 @@ func PublishLatestIssue(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFun
|
||||
return
|
||||
}
|
||||
|
||||
article.Link = fmt.Sprint("http://", c.Domain, c.Port, "/article/serve/", article.ID)
|
||||
article.Link = fmt.Sprint(c.Domain, c.Port, "/article/serve/", article.ID)
|
||||
if err = db.UpdateAttributes(&b.Attribute{Table: "articles", ID: article.ID, AttName: "link", Value: article.Link}); err != nil {
|
||||
log.Println(err)
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
|
Loading…
x
Reference in New Issue
Block a user