[Uptime] Fix headers io-ts type (#84089)

This commit is contained in:
Shahzad 2020-11-26 10:08:45 +01:00 committed by GitHub
parent fac792778e
commit a4c8dca021
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -86,6 +86,10 @@ export const MonitorType = t.intersection([
export type Monitor = t.TypeOf<typeof MonitorType>;
export const PingHeadersType = t.record(t.string, t.union([t.string, t.array(t.string)]));
export type PingHeaders = t.TypeOf<typeof PingHeadersType>;
export const PingType = t.intersection([
t.type({
timestamp: t.string,
@ -135,7 +139,7 @@ export const PingType = t.intersection([
bytes: t.number,
redirects: t.array(t.string),
status_code: t.number,
headers: t.record(t.string, t.string),
headers: PingHeadersType,
}),
version: t.string,
}),

View file

@ -7,9 +7,10 @@
import React from 'react';
import { EuiAccordion, EuiDescriptionList, EuiSpacer, EuiText } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { PingHeaders as HeadersProp } from '../../../../common/runtime_types';
interface Props {
headers: Record<string, string>;
headers: HeadersProp;
}
export const PingHeaders = ({ headers }: Props) => {