diff --git a/Makefile b/Makefile index 1c5b038..fb08e72 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-lib-docker -PKG_VERSION:=v0.3.0 +PKG_VERSION:=v0.3.1 PKG_RELEASE:=beta PKG_MAINTAINER:=lisaac PKG_LICENSE:=AGPL-3.0 diff --git a/luasrc/docker.lua b/luasrc/docker.lua index fce5fa9..881f894 100644 --- a/luasrc/docker.lua +++ b/luasrc/docker.lua @@ -180,8 +180,6 @@ end local gen_header = function(options, http_method, api_group, api_action, name_or_id, request) local header, query, path - options = options or {} - options.protocol = options.protocol or "HTTP/1.1" name_or_id = (name_or_id ~= "") and name_or_id or nil if request and type(request.query) == "table" then @@ -372,8 +370,8 @@ function _docker.new(options) local _options = options or {} docker.options = { socket_path = _options.socket_path or nil, - host = _options.host or "localhost", - port = _options.port or "2375", + host = _options.socket_path and "localhost" or _options.host, + port = not _options.socket_path and _options.port or nil, tls = _options.tls or nil, tls_cacert = _options.tls and _options.tls_cacert or nil, tls_cert = _options.tls and _options.tls_cert or nil,