Skip to content
  • Stan Hu's avatar
    fix: handle 403 errors when artifacts loaded from GitLab artifacts browser · 15946085
    Stan Hu authored
    When the artifacts server is enabled, GitLab Rails links certain files
    (e.g. HTML) to the GitLab Pages server so that the file can be rendered
    instead of downloaded. However, if public pipelines are not enabled for
    a public project and the user never authenticated with the Pages server,
    the GitLab Artifacts API would return a 403 error. This error would be
    forwarded to the user, and Pages would halt further processing.
    
    To fix this problem, when we encounter a 403 error, we attempt to
    authenticate the user if no token is available.
    
    Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/25192
    
    Changelog: fixed
    15946085