mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
Add public timeline
This commit is contained in:
parent
bff170d2e2
commit
b7587f8d3f
9 changed files with 158 additions and 7 deletions
|
|
@ -1,10 +1,24 @@
|
|||
import { APActivity, APObject } from "activitypub-types";
|
||||
import { NodeObject } from "jsonld";
|
||||
|
||||
export const jsonResponse = (data: object, status = 200) => {
|
||||
export const jsonResponse = (
|
||||
data: object,
|
||||
status = 200,
|
||||
headers: Record<string, string> = {}
|
||||
) => {
|
||||
return new Response(JSON.stringify(data), {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Frame-Options": "DENY",
|
||||
"X-Permitted-Cross-Domain-Policies": "none",
|
||||
"Access-Control-Allow-Credentials": "true",
|
||||
"Access-Control-Allow-Headers":
|
||||
"Authorization,Content-Type,Idempotency-Key",
|
||||
"Access-Control-Allow-Methods": "POST,PUT,DELETE,GET,PATCH,OPTIONS",
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Access-Control-Expose-Headers":
|
||||
"Link,X-RateLimit-Reset,X-RateLimit-Limit,X-RateLimit-Remaining,X-Request-Id,Idempotency-Key",
|
||||
...headers,
|
||||
},
|
||||
status,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue