lib/vagrant-skytap/api/client.rb in vagrant-skytap-0.2.8 vs lib/vagrant-skytap/api/client.rb in vagrant-skytap-0.2.9
- old
+ new
@@ -19,10 +19,11 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
require 'base64'
+require "vagrant-skytap/version"
module VagrantPlugins
module Skytap
module API
class Client
@@ -127,15 +128,19 @@
errors if errors.present?
end
private
+ def user_agent_string
+ "Vagrant-Skytap/#{VagrantPlugins::Skytap::VERSION} Vagrant/#{Vagrant::VERSION}"
+ end
def default_headers
{
'Authorization' => auth_header,
'Content-Type' => 'application/json',
- 'Accept' => 'application/json'
+ 'Accept' => 'application/json',
+ 'User-Agent' => user_agent_string,
}
end
def auth_header
"Basic #{Base64.encode64(config.username + ":" +