From 6d05065659fb50cb06c71475a9c67b9e529ce4df Mon Sep 17 00:00:00 2001 From: sunstep <73174517+sunstep@users.noreply.github.com> Date: Sun, 15 Sep 2024 12:07:46 +0200 Subject: [PATCH] Convert the headers to string It seems like all HTTP headers are string, while other types may work, its more safe to convert the types to strings to ensure no trouble is caused by non string types. Even if it does work, at least now the types are consistent, as headers are being put as string and they are also retrieved as string. --- app/controllers/api/v1/points_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/v1/points_controller.rb b/app/controllers/api/v1/points_controller.rb index 6a7d2e59..fbf200c4 100644 --- a/app/controllers/api/v1/points_controller.rb +++ b/app/controllers/api/v1/points_controller.rb @@ -12,8 +12,8 @@ class Api::V1::PointsController < ApiController .page(params[:page]) .per(params[:per_page] || 100) - response.set_header('X-Current-Page', points.current_page) - response.set_header('X-Total-Pages', points.total_pages) + response.set_header('X-Current-Page', points.current_page.to_s) + response.set_header('X-Total-Pages', points.total_pages.to_s) render json: points end