Skip to content

Commit

Permalink
fix(prose): only proxy requests to pgs if an image
Browse files Browse the repository at this point in the history
  • Loading branch information
neurosnap committed Jan 20, 2025
1 parent 4ee6d08 commit 49f863d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions auth/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,12 +542,14 @@ func AddPlusFeedForUser(dbpool db.DB, userID, email string) error {
text := fmt.Sprintf(`=: email %s
=: digest_interval 1day
=> %s`, email, href)
now := time.Now()
_, err = dbpool.InsertPost(&db.Post{
UserID: userID,
Text: text,
Space: "feeds",
Slug: "pico-plus",
Filename: "pico-plus",
UserID: userID,
Text: text,
Space: "feeds",
Slug: "pico-plus",
Filename: "pico-plus",
PublishAt: &now,
})
return err
}
Expand Down
2 changes: 1 addition & 1 deletion prose/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ func createSubdomainRoutes(staticRoutes []shared.Route) []shared.Route {
routes,
shared.NewRoute("GET", "/raw/(.+)", postRawHandler),
shared.NewRoute("GET", "/(.+).md", postRawHandler),
shared.NewRoute("GET", "/([^/]+)/(.+)", imgRequest),
shared.NewRoute("GET", "/(.+.(?:jpg|jpeg|png|gif|webp|svg))/(.+)", imgRequest),
shared.NewRoute("GET", "/(.+.(?:jpg|jpeg|png|gif|webp|svg))$", imgRequest),
shared.NewRoute("GET", "/(.+).html", postHandler),
shared.NewRoute("GET", "/(.+)", postHandler),
Expand Down

0 comments on commit 49f863d

Please sign in to comment.