Skip to content

Commit

Permalink
fix bug 1295949 for public artifacts (#143)
Browse files Browse the repository at this point in the history
* fix bug 1295949 for public artifacts

* Addressed feedback from @dustin @eliperelman
  • Loading branch information
jonasfj authored and eliperelman committed Oct 1, 2016
1 parent a37a7ca commit 309a9e3
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/lib/ui/artifactlist.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,20 @@ export default React.createClass({
let icon;

if (/^public\//.test(artifact.name)) {
url = 'https://queue.taskcluster.net/v1/task/';
if (this.props.runId != null) {
url = this.queue.buildUrl(
this.queue.getArtifact,
this.props.taskId,
this.props.runId,
artifact.name
);
url += `${this.props.taskId}/runs/${this.props.runId}/artifacts/${artifact.name}`;
// We could use queue.buildUrl as follows, but this creates URLs where artifact name
// has slashes encoded. For artifacts we specifically allow slashes in the name not
// to be encoded, as this make things like: $ wget <url> create files with nice names.
// url = this.queue.buildUrl(
// this.queue.getArtifact,
// this.props.taskId,
// this.props.runId,
// artifact.name
// );
} else {
url = this.queue.buildUrl(
this.queue.getLatestArtifact,
this.props.taskId,
artifact.name
);
url += `${this.props.taskId}/artifacts/${artifact.name}`;
}

icon = getIconFromMime(artifact.contentType);
Expand Down

0 comments on commit 309a9e3

Please sign in to comment.