Download Artifacts via REST from a Branch with a Slash

Answered

Hi,

how can I download artifacts via the REST API from a branch with a slash in its name? The following URL isn't working:
https://teamcity/app/rest/builds/buildType:(id:<CONFIG_ID>),status:SUCCESS,branch:(name:bugfix/test)/artifacts/content/*.bin

Kind regards, Mario

1 comment
Comment actions Permalink

Hi,

You'll need to use the escape character for '/', which is '%2F'. However, Tomcat has a default setting that makes this not possible, as seen in TW-19360. It will be necessary to add the following options to your TEAMCITY_SERVER_OPTS environment variable in order to change this setting.

-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true
-Dorg.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true

The resulting endpoint would be:

https://teamcity/app/rest/builds/buildType:(id:<CONFIG_ID>),status:SUCCESS,branch:(name:bugfix%2Ftest)/artifacts/content/*.bin

 

0

Please sign in to leave a comment.