Project

General

Profile

Revision c69bcf98

Added by Sebastian Gräßl about 5 years ago

Fixes #20355 - Request registry results in JSON

View differences:

app/models/service/registry_api.rb
1 1
module Service
2 2
  class RegistryApi
3
    DOCKER_HUB = 'https://registry.hub.docker.com/'.freeze
3
    DOCKER_HUB = 'https://index.docker.io/'.freeze
4 4
    DEFAULTS = {
5 5
      url: 'http://localhost:5000'.freeze,
6
      connection: { omit_default_port: true }
6
      connection: { omit_default_port: true,
7
                    headers: { "Content-Type" => "application/json" }}
7 8
    }
8 9

  
9 10
    attr_accessor :config, :url
test/units/registry_api_test.rb
13 13
      assert_equal url, subject.connection.url
14 14
    end
15 15

  
16
    test 'it requests json' do
17
      assert_equal 'application/json', subject.connection.options[:headers]['Content-Type']
18
    end
19

  
16 20
    context 'authentication is set' do
17 21
      let(:user) { 'username' }
18 22
      let(:password) { 'secretpassword' }

Also available in: Unified diff