fix no magic
parent
f17ef9bad2
commit
cf2b81cb2e
|
|
@ -69,15 +69,18 @@ export async function getStatusWithGlobalPing(
|
|||
globalPingRequest = {
|
||||
type: 'ping',
|
||||
target: targetUrl.hostname,
|
||||
locations: [
|
||||
{
|
||||
magic: gpUrl.searchParams.get('magic') || '',
|
||||
},
|
||||
],
|
||||
locations:
|
||||
gpUrl.searchParams.get('magic') !== null
|
||||
? [
|
||||
{
|
||||
magic: gpUrl.searchParams.get('magic'),
|
||||
},
|
||||
]
|
||||
: undefined,
|
||||
measurementOptions: {
|
||||
port: targetUrl.port,
|
||||
packets: 1,
|
||||
protocol: 'tcp',
|
||||
protocol: 'tcp', // TODO: icmp?
|
||||
ipVersion: Number(gpUrl.searchParams.get('ipVersion') || 4),
|
||||
},
|
||||
}
|
||||
|
|
@ -92,11 +95,14 @@ export async function getStatusWithGlobalPing(
|
|||
globalPingRequest = {
|
||||
type: 'http',
|
||||
target: targetUrl.hostname,
|
||||
locations: [
|
||||
{
|
||||
magic: gpUrl.searchParams.get('magic') || '',
|
||||
},
|
||||
],
|
||||
locations:
|
||||
gpUrl.searchParams.get('magic') !== null
|
||||
? [
|
||||
{
|
||||
magic: gpUrl.searchParams.get('magic'),
|
||||
},
|
||||
]
|
||||
: undefined,
|
||||
measurementOptions: {
|
||||
request: {
|
||||
method: monitor.method,
|
||||
|
|
@ -104,7 +110,7 @@ export async function getStatusWithGlobalPing(
|
|||
query: targetUrl.search === '' ? undefined : targetUrl.search,
|
||||
headers: Object.fromEntries(
|
||||
Object.entries(monitor.headers ?? {}).map(([key, value]) => [key, String(value)])
|
||||
), // TODO: headers
|
||||
), // TODO: host header?
|
||||
},
|
||||
port:
|
||||
targetUrl.port === ''
|
||||
|
|
|
|||
|
|
@ -86,7 +86,9 @@ async function webhookNotify(webhook: WebhookConfig, message: string) {
|
|||
let url = webhook.url
|
||||
let method = webhook.method
|
||||
let headers = new Headers(webhook.headers as any)
|
||||
let payloadTemplated: { [key: string]: string | number } = JSON.parse(JSON.stringify(webhook.payload))
|
||||
let payloadTemplated: { [key: string]: string | number } = JSON.parse(
|
||||
JSON.stringify(webhook.payload)
|
||||
)
|
||||
templateWebhookPlayload(payloadTemplated, message)
|
||||
let body = undefined
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue