feature/id-for-hmtl-headers #3
@@ -94,7 +94,7 @@ func SubmitArticle(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFunc {
 | 
				
			|||||||
			return
 | 
								return
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		article.Link = fmt.Sprint(c.Domain, c.Port, "/article/serve/", article.ID)
 | 
							article.Link = fmt.Sprint(c.Domain, "/article/serve/", article.ID)
 | 
				
			||||||
		if err = db.UpdateAttributes(&b.Attribute{Table: "articles", ID: article.ID, AttName: "link", Value: article.Link}); err != nil {
 | 
							if err = db.UpdateAttributes(&b.Attribute{Table: "articles", ID: article.ID, AttName: "link", Value: article.Link}); err != nil {
 | 
				
			||||||
			log.Println(err)
 | 
								log.Println(err)
 | 
				
			||||||
			http.Error(w, err.Error(), http.StatusInternalServerError)
 | 
								http.Error(w, err.Error(), http.StatusInternalServerError)
 | 
				
			||||||
@@ -502,7 +502,7 @@ func UploadArticleImage(c *b.Config, s *b.CookieStore) http.HandlerFunc {
 | 
				
			|||||||
			return
 | 
								return
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		url := fmt.Sprint(c.Domain, c.Port, "/image/serve/", filename)
 | 
							url := fmt.Sprint(c.Domain, "/image/serve/", filename)
 | 
				
			||||||
		w.Header().Set("Content-Type", "application/json")
 | 
							w.Header().Set("Content-Type", "application/json")
 | 
				
			||||||
		json.NewEncoder(w).Encode(url)
 | 
							json.NewEncoder(w).Encode(url)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -60,7 +60,7 @@ func PublishLatestIssue(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFun
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		article := &b.Article{
 | 
							article := &b.Article{
 | 
				
			||||||
			Title:     "Autogenerated cpolis Issue Article",
 | 
								Title:     "Autogenerated cpolis Issue Article",
 | 
				
			||||||
			EncURL:    fmt.Sprint(c.Domain, c.Port, "/image/serve/", imgFileName),
 | 
								EncURL:    fmt.Sprint(c.Domain, "/image/serve/", imgFileName),
 | 
				
			||||||
			EncLength: int(imgSize),
 | 
								EncLength: int(imgSize),
 | 
				
			||||||
			EncType:   mimeType,
 | 
								EncType:   mimeType,
 | 
				
			||||||
			Published: true,
 | 
								Published: true,
 | 
				
			||||||
@@ -84,7 +84,7 @@ func PublishLatestIssue(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFun
 | 
				
			|||||||
			return
 | 
								return
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		article.Link = fmt.Sprint(c.Domain, c.Port, "/article/serve/", article.ID)
 | 
							article.Link = fmt.Sprint(c.Domain, "/article/serve/", article.ID)
 | 
				
			||||||
		if err = db.UpdateAttributes(&b.Attribute{Table: "articles", ID: article.ID, AttName: "link", Value: article.Link}); err != nil {
 | 
							if err = db.UpdateAttributes(&b.Attribute{Table: "articles", ID: article.ID, AttName: "link", Value: article.Link}); err != nil {
 | 
				
			||||||
			log.Println(err)
 | 
								log.Println(err)
 | 
				
			||||||
			http.Error(w, err.Error(), http.StatusInternalServerError)
 | 
								http.Error(w, err.Error(), http.StatusInternalServerError)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user