Skip to content

Download directory URL contains duplicate "?" in GitLab CE 18.4.1 (Helm chart deployment)

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

When using GitLab CE 18.4.1 deployed via Helm chart, the Download directory option generates an invalid URL with duplicate ? characters, causing the download to fail.

Steps to reproduce

  1. Deploy GitLab CE 18.4.1 using the official Helm chart.
  2. Open any project.
  3. Go to Code → Download directory.
  4. Observe the generated URL.

Example Project

N/A (happens with any project).

What is the current bug behavior?

The generated download URL looks like:

https://gitlab.abc/group/project/-/archive/main/project-main.zip?ref_type=heads?path=abc-1.0-SNAPSHOT

It contains two ? characters, which makes the request fail and prevents the directory from being downloaded.

What is the expected correct behavior?

The generated URL should only contain a single ? and use & for additional query parameters, for example:

https://gitlab.abc/group/project/-/archive/main/project-main.zip?ref_type=heads&path=abc-1.0-SNAPSHOT

Relevant logs and/or screenshots

Screenshot of the generated URL:

(Add here if available)

Output of checks

Results of GitLab environment info

  • GitLab Edition: CE
  • GitLab Version: 18.4.1
  • Deployment method: Helm chart

Results of GitLab application Check

(Please run if needed, but the bug seems UI/URL related and reproducible without checks)

Possible fixes

Likely in the code that generates the archive download URL. The second query parameter (path) should be concatenated with & instead of ?.

Untitled

Implementation plans

Note, the code dropdown shown in the screenshot is behind a defaulted true feature flag directory_code_dropdown_updates

The logic for the download links is from a computed property in compact_code_dropdown. we just need to correct the logic there.

Edited by 🤖 GitLab Bot 🤖