Browse Source

fix(api): rewrite entry content URLs with media proxy in fetchContent endpoint

Jiacheng 4 months ago
parent
commit
b3a63dbd86
1 changed files with 1 additions and 5 deletions
  1. 1 5
      internal/api/entry.go

+ 1 - 5
internal/api/entry.go

@@ -341,13 +341,9 @@ func (h *handler) fetchContent(w http.ResponseWriter, r *http.Request) {
 			json.ServerError(w, r, err)
 			return
 		}
-
-		json.OK(w, r, map[string]any{"content": mediaproxy.RewriteDocumentWithRelativeProxyURL(h.router, entry.Content), "reading_time": entry.ReadingTime})
-
-		return
 	}
 
-	json.OK(w, r, map[string]string{"content": entry.Content})
+	json.OK(w, r, map[string]any{"content": mediaproxy.RewriteDocumentWithAbsoluteProxyURL(h.router, entry.Content), "reading_time": entry.ReadingTime})
 }
 
 func (h *handler) flushHistory(w http.ResponseWriter, r *http.Request) {