From 56fcfe2babe84c21a4f806679ef123d5db2f740e Mon Sep 17 00:00:00 2001 From: Stephen Salinas Date: Tue, 9 May 2017 17:59:35 -0400 Subject: [PATCH] ensure path is set on read endpoint --- .../com/hubspot/singularity/resources/SandboxResource.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SingularityService/src/main/java/com/hubspot/singularity/resources/SandboxResource.java b/SingularityService/src/main/java/com/hubspot/singularity/resources/SandboxResource.java index 4bd926161c..a09eccf20c 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/resources/SandboxResource.java +++ b/SingularityService/src/main/java/com/hubspot/singularity/resources/SandboxResource.java @@ -1,6 +1,7 @@ package com.hubspot.singularity.resources; import static com.hubspot.singularity.WebExceptions.badRequest; +import static com.hubspot.singularity.WebExceptions.checkBadRequest; import static com.hubspot.singularity.WebExceptions.checkNotFound; import static com.hubspot.singularity.WebExceptions.notFound; @@ -137,6 +138,8 @@ public MesosFileChunkObject read(@ApiParam("The task ID of the sandbox to read f final SingularityTaskHistory history = checkHistory(taskId); + checkBadRequest(!Strings.isNullOrEmpty(path), "Must specify 'path'"); + final String slaveHostname = history.getTask().getOffer().getHostname(); final String fullPath = new File(history.getDirectory().get(), path).toString();