Skip to content
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

no content types unsupported by bintray registry #7

Open
eeh opened this issue Nov 30, 2015 · 1 comment
Open

no content types unsupported by bintray registry #7

eeh opened this issue Nov 30, 2015 · 1 comment

Comments

@eeh
Copy link

eeh commented Nov 30, 2015

Hello,

I am using a cloud based build system (wercker) pushing docker images to a cloud registry (bintray). Wercker is using your library under the hood, and after some hours of troubleshooting, i have come to the conclusion that you are not sending "content-type=application/json" in the headers on your REST calls.

I have a super trivial example here:

package main

import "net/url"
import "fmt"
import "github.com/CenturyLinkLabs/docker-reg-client/registry"

func main() {

    c := registry.NewClient()

    c.BaseURL, _ = url.Parse("http://localhost:3000/v1/")
    fmt.Println(c.BaseURL.String())
    auth := registry.BasicAuth{"user", "password"}

    err := c.Repository.SetTag("bah", "boh", "1.0", auth)

    fmt.Println(err)

}

So when inspecting the calls on the server side, it kind of looks like this:

url:/v1/repositories/bah/tags/1.0
headers:
{ host: 'localhost:3000',
  'user-agent': 'Go-http-client/1.1',
  'content-length': '6',
  authorization: 'Basic dXNlcjpwYXNzd29yZA==',
  'accept-encoding': 'gzip' }
method:PUT

From what I can gather, when looking at the docs over here:
https://docs.docker.com/v1.6/reference/api/registry_api/
It seems that they imply that all requests should have a content type header, and my guess would be that the guys over at bintray.com have elected to enforce that.

Can you please modify your code to send content-type headers?

Thanks,
Emil

@davidgardner11
Copy link

Hi @eeh - I've added this issue to our bug fix list, but I don't have a date for you.

My recommendation is that you implement and test the required fix, and then submit a PR for us to test and merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants