Skip to content

Commit

Permalink
Merge pull request #1535 from HubSpot/verify_path
Browse files Browse the repository at this point in the history
Ensure path is set on read endpoint
  • Loading branch information
ssalinas authored May 22, 2017
2 parents b3627ec + 56fcfe2 commit 6d29d45
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 6d29d45

Please sign in to comment.