17 lines
460 B
TypeScript
17 lines
460 B
TypeScript
import type { ProblemDetails } from "@minecraft-account-manager/contracts";
|
|
|
|
export function problemInstance(request: Request) {
|
|
const url = new URL(request.url);
|
|
return `${url.pathname}${url.search}`;
|
|
}
|
|
|
|
export function problemResponse(problem: ProblemDetails) {
|
|
return new Response(JSON.stringify(problem), {
|
|
status: problem.status,
|
|
headers: {
|
|
"cache-control": "no-store",
|
|
"content-type": "application/problem+json",
|
|
},
|
|
});
|
|
}
|