kopia lustrzana https://github.com/cloudflare/wildebeest
rodzic
d997d0ca06
commit
b9927c3dfe
|
@ -2,6 +2,7 @@ import { strict as assert } from 'node:assert/strict'
|
|||
import * as nodeinfo_21 from 'wildebeest/functions/nodeinfo/2.1'
|
||||
import * as nodeinfo_20 from 'wildebeest/functions/nodeinfo/2.0'
|
||||
import * as nodeinfo from 'wildebeest/functions/.well-known/nodeinfo'
|
||||
import { assertCORS } from './utils'
|
||||
|
||||
const domain = 'example.com'
|
||||
|
||||
|
@ -9,6 +10,7 @@ describe('NodeInfo', () => {
|
|||
test('well-known returns links', async () => {
|
||||
const res = await nodeinfo.handleRequest(domain)
|
||||
assert.equal(res.status, 200)
|
||||
assertCORS(res)
|
||||
|
||||
const data = await res.json<any>()
|
||||
assert.equal(data.links.length, 2)
|
||||
|
@ -17,6 +19,7 @@ describe('NodeInfo', () => {
|
|||
test('expose NodeInfo version 2.0', async () => {
|
||||
const res = await nodeinfo_20.handleRequest()
|
||||
assert.equal(res.status, 200)
|
||||
assertCORS(res)
|
||||
|
||||
const data = await res.json<any>()
|
||||
assert.equal(data.version, '2.0')
|
||||
|
@ -25,6 +28,7 @@ describe('NodeInfo', () => {
|
|||
test('expose NodeInfo version 2.1', async () => {
|
||||
const res = await nodeinfo_21.handleRequest()
|
||||
assert.equal(res.status, 200)
|
||||
assertCORS(res)
|
||||
|
||||
const data = await res.json<any>()
|
||||
assert.equal(data.version, '2.1')
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import type { Env } from 'wildebeest/backend/src/types/env'
|
||||
import { cors } from 'wildebeest/backend/src/utils/cors'
|
||||
|
||||
const headers = {
|
||||
...cors(),
|
||||
'content-type': 'application/json',
|
||||
'cache-control': 'max-age=259200, public',
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import type { Env } from 'wildebeest/backend/src/types/env'
|
||||
import { WILDEBEEST_VERSION } from 'wildebeest/config/versions'
|
||||
import { cors } from 'wildebeest/backend/src/utils/cors'
|
||||
|
||||
const headers = {
|
||||
...cors(),
|
||||
'content-type': 'application/json',
|
||||
'cache-control': 'max-age=259200, public',
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import type { Env } from 'wildebeest/backend/src/types/env'
|
||||
import { cors } from 'wildebeest/backend/src/utils/cors'
|
||||
import { WILDEBEEST_VERSION } from 'wildebeest/config/versions'
|
||||
|
||||
const headers = {
|
||||
...cors(),
|
||||
'content-type': 'application/json',
|
||||
'cache-control': 'max-age=259200, public',
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue