Skip to content

Commit

Permalink
[Uptime] Fix headers io-ts type (#84089)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed Nov 26, 2020
1 parent fac7927 commit a4c8dca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion x-pack/plugins/uptime/common/runtime_types/ping/ping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit a4c8dca

Please sign in to comment.