Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lifegpc committed Jun 2, 2024
1 parent 2454e0c commit fd88b83
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion routes/api/file/random.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { User, UserPermission } from "../../../db.ts";
import pbkdf2Hmac from "pbkdf2-hmac";
import { encodeBase64 as encode } from "@std/encoding/base64";
import { return_data } from "../../../server/utils.ts";
import { extname } from "@std/path";

export const handler: Handlers = {
async GET(req, ctx) {
Expand Down Expand Up @@ -121,9 +122,10 @@ export const handler: Handlers = {
),
);
if (m.cfg.use_path_based_img_url) {
const ext = extname(f.path);
url = `${get_host(req)}/file/${
encodeURIComponent(verify)
}/${f.id}`;
}/${f.id}${ext}`;
} else {
const b = new URLSearchParams();
b.append("verify", verify);
Expand Down

0 comments on commit fd88b83

Please sign in to comment.