diff --git a/.app_version b/.app_version index df47809d..379191a4 100644 --- a/.app_version +++ b/.app_version @@ -1 +1 @@ -0.23.6 +0.23.7 diff --git a/CHANGELOG.md b/CHANGELOG.md index 9024ee26..095bcdb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/app/controllers/api/v1/health_controller.rb b/app/controllers/api/v1/health_controller.rb index 87df7d96..8e13d165 100644 --- a/app/controllers/api/v1/health_controller.rb +++ b/app/controllers/api/v1/health_controller.rb @@ -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 diff --git a/spec/requests/api/v1/health_spec.rb b/spec/requests/api/v1/health_spec.rb index 4861b399..139a207c 100644 --- a/spec/requests/api/v1/health_spec.rb +++ b/spec/requests/api/v1/health_spec.rb @@ -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