Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] [Uptime] Fix headers io-ts type (#84089) #84449

Merged
merged 1 commit into from
Nov 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -85,6 +85,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 @@ -145,7 +149,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