New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API should handle unescaped URIs #5101

supermarin opened this Issue Nov 12, 2015 · 2 comments


None yet
3 participants
Copy link

supermarin commented Nov 12, 2015

Triggering jobs via API requires the user to manually escape slashes into %2F.
It makes the URI harder to read, because escaping happens only in the slug:

    curl --silent --request POST --data "$body" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "Travis-API-Version: 3" \
        --header "Authorization: token $TRAVIS_TOKEN" \

And it makes the end user do terrible things like this to invoke jobs:


This comment has been minimized.

Copy link

rkh commented Nov 13, 2015

I'm very 👎 on this. It's causing issues in our old API at the moment (try calling your repository "settings" or "requests").

Escaping happens properly as defined by RFC 6570 and RFC 3986.

If the URI is not written by hand, but generated, I would recommend to do proper URI escaping in the first place. Better yet, actually use a URI Template library. That way you'll make sure this easily works with Travis Enterprise.

Not 100% sure what the best way in Bash would be, in Ruby I'd do something like this:

require 'addressable/template'

# this can also be programatically discovered by fetching
template = '{repository.slug}/requests'
url      = template.expand("repository.slug" => "user/repo"), ...)

This comment has been minimized.

Copy link

BanzaiMan commented Feb 26, 2016

Closing for now.

@BanzaiMan BanzaiMan closed this Feb 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment