Skip to content

Fix redirect loop when relative url root is blank

What does this MR do?

A blank string won't work here because we would get something like:

Set-Cookie
	_gitlab_session_46b50a5ce095516649353456113c2c52bfa15f750141eae5a46e46848591a056=ee92dc96cbf081352d951b0f4bbb4bba; path=; HttpOnly

And then when inspecting the stored cookie:

Screen_Shot_2021-07-29_at_11.25.20_AM

The path is set to /users.

This causes a redirect loop because when /users/sign_in is requested, the cookies are included so it redirects to /. But when / is requested the cookies aren't present so it redirects to /users/sign_in.

Right now the GDK default is / but we want to change this to an empty string because of #195514 (closed)

Screenshots or Screencasts (strongly suggested)

How to setup and validate locally (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Heinrich Lee Yu

Merge request reports

Loading