Skip to content

Introduce headers for router type/action

Manoj M J requested to merge mmj-headers into main

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 is classify.

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 be proxy or classify
  • X-GitLab-HTTP-Router-Rule-Type is only added if the rule is classsify. Currently it can only have the value of FirstCell. Once we introduce session prefixed based routing, this can also take the value of SessionPrefix.

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:

Screenshot_2024-08-09_at_2.48.59_PM

Screenshot_2024-08-09_at_2.49.52_PM

Edited by Manoj M J

Merge request reports

Loading