fix type
This commit is contained in:
parent
9973610286
commit
e543ffe368
|
@ -19,7 +19,7 @@ import type { PrivateKeyWithPem, PrivateKey } from '@misskey-dev/node-http-messa
|
||||||
|
|
||||||
export async function createSignedPost(args: { level: string; key: PrivateKey; url: string; body: string; digest?: string, additionalHeaders: Record<string, string> }) {
|
export async function createSignedPost(args: { level: string; key: PrivateKey; url: string; body: string; digest?: string, additionalHeaders: Record<string, string> }) {
|
||||||
const u = new URL(args.url);
|
const u = new URL(args.url);
|
||||||
const request: RequestLike = {
|
const request = {
|
||||||
url: u.href,
|
url: u.href,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -27,7 +27,7 @@ export async function createSignedPost(args: { level: string; key: PrivateKey; u
|
||||||
'Host': u.host,
|
'Host': u.host,
|
||||||
'Content-Type': 'application/activity+json',
|
'Content-Type': 'application/activity+json',
|
||||||
...args.additionalHeaders,
|
...args.additionalHeaders,
|
||||||
},
|
} as Record<string, string>,
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: httpMessageSignaturesImplementationLevelによって新規格で通信をするようにする
|
// TODO: httpMessageSignaturesImplementationLevelによって新規格で通信をするようにする
|
||||||
|
@ -48,7 +48,7 @@ export async function createSignedPost(args: { level: string; key: PrivateKey; u
|
||||||
|
|
||||||
export async function createSignedGet(args: { level: string; key: PrivateKey; url: string; additionalHeaders: Record<string, string> }) {
|
export async function createSignedGet(args: { level: string; key: PrivateKey; url: string; additionalHeaders: Record<string, string> }) {
|
||||||
const u = new URL(args.url);
|
const u = new URL(args.url);
|
||||||
const request: RequestLike = {
|
const request = {
|
||||||
url: u.href,
|
url: u.href,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -56,7 +56,7 @@ export async function createSignedGet(args: { level: string; key: PrivateKey; ur
|
||||||
'Date': new Date().toUTCString(),
|
'Date': new Date().toUTCString(),
|
||||||
'Host': new URL(args.url).host,
|
'Host': new URL(args.url).host,
|
||||||
...args.additionalHeaders,
|
...args.additionalHeaders,
|
||||||
},
|
} as Record<string, string>,
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: httpMessageSignaturesImplementationLevelによって新規格で通信をするようにする
|
// TODO: httpMessageSignaturesImplementationLevelによって新規格で通信をするようにする
|
||||||
|
|
Loading…
Reference in New Issue