Merge pull request #803 from Freika/feature/app-version-in-health-response

Return app version in health response
This commit is contained in:
Evgenii Burmakin 2025-02-06 20:14:22 +01:00 committed by GitHub
commit 4e0e9450d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 15 additions and 1 deletions

View file

@ -1 +1 @@
0.23.6
0.23.7

View file

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## 0.23.7 - 2025-02-06
### Added
- `X-Dawarich-Version` header to the `GET /api/v1/health` endpoint response.
# 0.23.6 - 2025-02-06
### Added

View file

@ -10,6 +10,8 @@ class Api::V1::HealthController < ApiController
response.set_header('X-Dawarich-Response', 'Hey, I\'m alive!')
end
response.set_header('X-Dawarich-Version', APP_VERSION)
render json: { status: 'ok' }
end
end

View file

@ -23,5 +23,11 @@ RSpec.describe 'Api::V1::Healths', type: :request do
expect(response.headers['X-Dawarich-Response']).to eq('Hey, I\'m alive and authenticated!')
end
end
it 'returns the correct version' do
get '/api/v1/health'
expect(response.headers['X-Dawarich-Version']).to eq(APP_VERSION)
end
end
end