Skip to content

Commit

Permalink
Remove legacy screenshot image codepath.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinkambic committed Dec 6, 2023
1 parent 05df654 commit 8b3cece
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions x-pack/plugins/synthetics/server/queries/journey_screenshots.ts
Expand Up @@ -9,7 +9,7 @@ import {
getJourneyScreenshot,
ScreenshotReturnTypesUnion,
} from '../legacy_uptime/lib/requests/get_journey_screenshot';
import { isFullScreenshot, isRefResult, RefResult } from '../../common/runtime_types';
import { isRefResult, RefResult } from '../../common/runtime_types';
import { RouteContext, UptimeRouteContext } from '../routes/types';

export type ClientContract = Buffer | { screenshotRef: RefResult };
Expand All @@ -35,15 +35,7 @@ export const journeyScreenshotHandler = async ({
stepIndex,
});

if (isFullScreenshot(result) && typeof result.synthetics?.blob !== 'undefined') {
return response.ok({
body: Buffer.from(result.synthetics.blob, 'base64'),
headers: {
'content-type': result.synthetics.blob_mime || 'image/png', // falls back to 'image/png' for earlier versions of synthetics
...getSharedHeaders(result.synthetics.step.name, result.totalSteps),
},
});
} else if (isRefResult(result)) {
if (isRefResult(result)) {
return response.ok({
body: {
screenshotRef: result,
Expand Down

0 comments on commit 8b3cece

Please sign in to comment.