Skip to content

Commit

Permalink
Merge pull request #16 from epimorphics/issue/189-x-request-id-propag…
Browse files Browse the repository at this point in the history
…ation-not-working

Issue: x-request-id propagation not working
  • Loading branch information
jonrandahl authored Oct 15, 2024
2 parents 2a41ca0 + b7cf650 commit e26b98b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
21 changes: 17 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
# Changelog for DS API rubygem

## 1.5.0 - 2023-06-23
## 1.5.1 - 2024-10-14

- (Jon) Fixed casing on the `X-Request-Id` header for SAPINT requests to match
the header received from the apps using the gem.
[GH-189](https://github.com/epimorphics/hmlr-ansible-deployment/issues/189)
- (Jon) Updated the previously supplied release date in the `v1.5.0` entry to
match the actual release date.
- (Jon) Updated the `version.rb` `SUFFIX` entry to be `nil` by default to ensure
the version number is correctly formatted.

## 1.5.0 - 2024-10-09

- (Dan) Updates ruby to 2.7.8 and version cadence to 1.5.0

## 1.4.1 - 2023-06-23

- (Jon) Now handles matching the message flag while ignoring the casing of the message
- (Jon) Better handling of reporting different logging levels using DRY principles
- (Jon) Now handles matching the message flag while ignoring the casing of the
message
- (Jon) Better handling of reporting different logging levels using DRY
principles
- (Jon) Resolves failing test for duration as integer

## 1.4.0 - 2023-06-21
Expand Down Expand Up @@ -40,7 +52,8 @@
to the system logs.
- (Jon) As part of the better logging updates the error message returned to the
requesting app has been refactored to be more concise as well the failed
connection error status has been set specifically to `503 Service Unavailable`.
connection error status has been set specifically to `503 Service
Unavailable`.

## 1.3.2 - 2022-04-01

Expand Down
4 changes: 2 additions & 2 deletions lib/data_services_api/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get_from_api(http_url, accept_headers, params, options) # rubocop:disable Me
conn = set_connection_timeout(create_http_connection(http_url))

response = conn.get do |req|
req.headers['X-Request-ID'] = Thread.current[:request_id] if Thread.current[:request_id]
req.headers['X-Request-Id'] = Thread.current[:request_id] if Thread.current[:request_id]
req.headers['Accept'] = accept_headers
req.options.params_encoder = Faraday::FlatParamsEncoder
req.params = params.merge(options)
Expand Down Expand Up @@ -91,7 +91,7 @@ def post_to_api(http_url, json)
conn = set_connection_timeout(create_http_connection(http_url))

response = conn.post do |req|
req.headers['X-Request-ID'] = Thread.current[:request_id] if Thread.current[:request_id]
req.headers['X-Request-Id'] = Thread.current[:request_id] if Thread.current[:request_id]
req.headers['Accept'] = 'application/json'
req.headers['Content-Type'] = 'application/json'
req.body = json
Expand Down
4 changes: 2 additions & 2 deletions lib/data_services_api/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module DataServicesApi
MAJOR = 1
MINOR = 5
PATCH = 0
SUFFIX = 0
PATCH = 1
SUFFIX = nil
VERSION = "#{MAJOR}.#{MINOR}.#{PATCH}#{SUFFIX && ".#{SUFFIX}"}"
end

0 comments on commit e26b98b

Please sign in to comment.