Skip to content

Commit b3a63db

Browse files
authored
fix(api): rewrite entry content URLs with media proxy in fetchContent endpoint
1 parent 7ac8eb9 commit b3a63db

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

internal/api/entry.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,13 +341,9 @@ func (h *handler) fetchContent(w http.ResponseWriter, r *http.Request) {
341341
json.ServerError(w, r, err)
342342
return
343343
}
344-
345-
json.OK(w, r, map[string]any{"content": mediaproxy.RewriteDocumentWithRelativeProxyURL(h.router, entry.Content), "reading_time": entry.ReadingTime})
346-
347-
return
348344
}
349345

350-
json.OK(w, r, map[string]string{"content": entry.Content})
346+
json.OK(w, r, map[string]any{"content": mediaproxy.RewriteDocumentWithAbsoluteProxyURL(h.router, entry.Content), "reading_time": entry.ReadingTime})
351347
}
352348

353349
func (h *handler) flushHistory(w http.ResponseWriter, r *http.Request) {

0 commit comments

Comments
 (0)