Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.
This repository was archived by the owner on May 1, 2020. It is now read-only.

Bug when rewriting url with %2F%2F #44

Closed
@La0

Description

@La0

Some artifacts have double slashes in their url: like for code-coverage artifacts like public/test_info//code-coverage-grcov.zip

The public url works fine, anyone can download that public artifact through https://queue.taskcluster.net.

But if a Taskcluster task uses the proxy, an url with double slashes will trigger a 301 redirection code toward the url with a single quote. That final url leads to a 404, and bad things happen.

I reproduced the issue locally using the latest release of taskcluster-proxy:

Test with an url with single /

Artifact name: public/logs/live.log ➡️ public%2Flogs%2Flive.log once url encoded

curl -v http://localhost:8080/queue/v1/task/OXhVOEchQlewyyWayyTxjA/runs/0/artifacts/public%2Ftest_info%2F%2Fcode-coverage-jsvm.zip
...
< HTTP/1.1 200 OK
< Accept-Ranges: bytes
< Age: 2480
< Content-Type: text/plain; charset=utf-8
< Date: Wed, 02 Oct 2019 12:47:28 GMT
< Etag: "c723fd8dbc0169de0a6f8c99c747e783"
< Last-Modified: Wed, 02 Oct 2019 12:45:17 GMT
< Server: AmazonS3
...
Log is served

Test with an url with double //

Artifact name: public/test_info//code-coverage-jsvm.zip ➡️ public%2Ftest_info%2F%2Fcode-coverage-jsvm.zip once url encoded

*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /queue/v1/task/OXhVOEchQlewyyWayyTxjA/runs/0/artifacts/public%2Ftest_info%2F%2Fcode-coverage-jsvm.zip HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.58.0
> Accept: */*
> 
< HTTP/1.1 301 Moved Permanently
< Content-Type: text/html; charset=utf-8
< Location: /queue/v1/task/OXhVOEchQlewyyWayyTxjA/runs/0/artifacts/public/test_info/code-coverage-jsvm.zip
< Date: Wed, 02 Oct 2019 13:30:44 GMT
< Content-Length: 129
< 
<a href="/queue/v1/task/OXhVOEchQlewyyWayyTxjA/runs/0/artifacts/public/test_info/code-coverage-jsvm.zip">Moved Permanently</a>.

* Connection #0 to host localhost left intact

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions