Skip to content

Commit

Permalink
Merge pull request #96 from sealink/TT-8142-add-minimal-user-agent
Browse files Browse the repository at this point in the history
TT-8142: Add user-agent header
  • Loading branch information
Sean Earle committed Oct 20, 2020
2 parents 314d998 + af182c1 commit 582d0c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).

## Unreleased
### Changed
- [TT-8142] Add suitable user-agent header

## [4.2.0]
### Changed
- [TT-7969] Update cassettes to work with HttpParty >= 0.18.1
Expand Down
2 changes: 2 additions & 0 deletions lib/quick_travel/adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ def self.call_and_validate(http_method, path, query = {}, opts = {})
http_params[:headers] ||= {}
http_params[:headers]['Content-length'] = '0' if http_params[:body].blank?
http_params[:headers]['x-api-key'] = QuickTravel.config.access_key
http_params[:headers]['user-agent'] = 'quicktravel_client/' + QuickTravel::VERSION;

expect = http_params.delete(:expect)

# Use :body instead of :query for put/post.
Expand Down

0 comments on commit 582d0c1

Please sign in to comment.