Explorar o código

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

Jiacheng hai 7 meses
pai
achega
b3a63dbd86
Modificáronse 1 ficheiros con 1 adicións e 5 borrados
  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)
 			json.ServerError(w, r, err)
 			return
 			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) {
 func (h *handler) flushHistory(w http.ResponseWriter, r *http.Request) {