Introduce headers for router type/action
Fixes the first of the asks in gitlab-org/gitlab#474268 (closed)
Add a new header
X-GitLab-HTTP-Router-Rule-Action
&X-GitLab-HTTP-Router-Rule-Type
with the value of the chosen rule and it's type. Type is added only if the action isclassify
.
This MR adds 2 headers to the request originating from the HTTP Router to the Rails app:
X-GitLab-HTTP-Router-Rule-Action
& X-GitLab-HTTP-Router-Rule-Type
-
X-GitLab-HTTP-Router-Rule-Action
can beproxy
orclassify
-
X-GitLab-HTTP-Router-Rule-Type
is only added if the rule isclasssify
. Currently it can only have the value ofFirstCell
. Once we introduce session prefixed based routing, this can also take the value ofSessionPrefix
.
See gitlab-org/gitlab#474268 (comment 2036640708) for the discussion surrounding implementation.
Screenshots
Screenshots from the logs of Rails app, when the headers are explicitly printed from ApplicationController
:
Edited by Manoj M J