mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
fix(federation): 🐛 Make HTTP header validation lowercase
This commit is contained in:
parent
9a917e2801
commit
df5e06ca8a
|
|
@ -39,9 +39,9 @@ export const schemas = {
|
||||||
uuid: z.string().uuid(),
|
uuid: z.string().uuid(),
|
||||||
}),
|
}),
|
||||||
header: z.object({
|
header: z.object({
|
||||||
"X-Signature": z.string(),
|
"x-signature": z.string(),
|
||||||
"X-Nonce": z.string(),
|
"x-nonce": z.string(),
|
||||||
"X-Signed-By": z.string().url().or(z.literal("instance")),
|
"x-signed-by": z.string().url().or(z.literal("instance")),
|
||||||
authorization: z.string().optional(),
|
authorization: z.string().optional(),
|
||||||
}),
|
}),
|
||||||
body: z.any(),
|
body: z.any(),
|
||||||
|
|
@ -57,9 +57,9 @@ export default apiRoute((app) =>
|
||||||
async (context) => {
|
async (context) => {
|
||||||
const { uuid } = context.req.valid("param");
|
const { uuid } = context.req.valid("param");
|
||||||
const {
|
const {
|
||||||
"X-Signature": signature,
|
"x-signature": signature,
|
||||||
"X-Nonce": nonce,
|
"x-nonce": nonce,
|
||||||
"X-Signed-By": signedBy,
|
"x-signed-by": signedBy,
|
||||||
authorization,
|
authorization,
|
||||||
} = context.req.valid("header");
|
} = context.req.valid("header");
|
||||||
const logger = getLogger(["federation", "inbox"]);
|
const logger = getLogger(["federation", "inbox"]);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue