✏️ Describe the feature
Currently, it responds to the request with contents as text/plain so they must be code files. However, some people might specify non-text files such as images or videos, so it should detect the file type and change the response MIME type.
✔︎ Confirm these checks
🗒️ Additional Information
|
export const router = new Router(); |
|
router |
|
.get("/", async <R extends string>(ctx: RouterContext<R>) => { |
|
ctx.response.type = "text/plain"; |
|
if (!redirect(ctx, ctx.request.userAgent)) await getContent(ctx); |
|
}) |
|
.get("/:ref", async <R extends string>(ctx: RouterContext<R>) => { |
|
const ref: string | undefined = ctx.params.ref; |
|
ctx.response.type = "text/plain"; |
|
if (!redirect(ctx, ctx.request.userAgent, ref)) await getContent(ctx, ref); |
|
}); |
✏️ Describe the feature
Currently, it responds to the request with contents as
text/plainso they must be code files. However, some people might specify non-text files such as images or videos, so it should detect the file type and change the response MIME type.✔︎ Confirm these checks
🗒️ Additional Information
reproxy/src/router.ts
Lines 4 to 14 in 1bb2d1f