Skip to content

Commit

Permalink
[Fleet] Correctly encode logs URL (#99782)
Browse files Browse the repository at this point in the history
Alejandro Fernández Gómez authored May 11, 2021
1 parent 6e8ccdb commit 37b7f6a
Showing 1 changed file with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -6,11 +6,11 @@
*/

import url from 'url';
import { stringify } from 'querystring';

import React, { memo, useMemo, useState, useCallback, useEffect } from 'react';
import styled from 'styled-components';
import { encode } from 'rison-node';
import { stringify } from 'query-string';
import {
EuiFlexGroup,
EuiFlexItem,
@@ -170,20 +170,17 @@ export const AgentLogsUI: React.FunctionComponent<AgentLogsProps> = memo(({ agen
http.basePath.prepend(
url.format({
pathname: '/app/logs/stream',
search: stringify(
{
logPosition: encode({
start: state.start,
end: state.end,
streamLive: false,
}),
logFilter: encode({
expression: logStreamQuery,
kind: 'kuery',
}),
},
{ sort: false, encode: false }
),
search: stringify({
logPosition: encode({
start: state.start,
end: state.end,
streamLive: false,
}),
logFilter: encode({
expression: logStreamQuery,
kind: 'kuery',
}),
}),
})
),
[http.basePath, state.start, state.end, logStreamQuery]

0 comments on commit 37b7f6a

Please sign in to comment.