[go: up one dir, main page]

Skip to content

Download redirection generate an url containing a double "/"

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

When we download the latest version of fail2ban_exporter the 302 redirect does contain a double "/" that leads to a 308.

https://gitlab.com/hctrdev/fail2ban-prometheus-exporter/-/releases/v0.10.2/downloads/fail2ban_exporter_0.10.2_linux_amd64.tar.gz

The translation from project name to project ID seems to have an extra “/” that is redirected with a 308 on the url without the double “/”.

It does leads to an issue with CI testing of ansible roles when testings agains version of python that do not manage 308 status code, it's a blocker for the ansible playbook to install the exporter:

Steps to reproduce

simply wget the file :

=== wget trace ===
$ wget https://gitlab.com/hctrdev/fail2ban-prometheus-exporter/-/releases/v0.10.2/downloads/fail2ban_exporter_0.10.2_linux_amd64.tar.gz
--2024-12-04 08:30:06--  https://gitlab.com/hctrdev/fail2ban-prometheus-exporter/-/releases/v0.10.2/downloads/fail2ban_exporter_0.10.2_linux_amd64.tar.gz
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Resolving gitlab.com (gitlab.com)... 2606:4700:90:0:f22e:fbec:5bed:a9b9, 172.65.251.78
Connecting to gitlab.com (gitlab.com)|2606:4700:90:0:f22e:fbec:5bed:a9b9|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://gitlab.com//-/project/24199687/uploads/3487e012ee493ccf8357b52e1061fe55/fail2ban_exporter_0.10.2_linux_amd64.tar.gz [following]
--2024-12-04 08:30:06--  https://gitlab.com//-/project/24199687/uploads/3487e012ee493ccf8357b52e1061fe55/fail2ban_exporter_0.10.2_linux_amd64.tar.gz
Reusing existing connection to [gitlab.com]:443.
HTTP request sent, awaiting response... 308 Permanent Redirect
Location: https://gitlab.com/-/project/24199687/uploads/3487e012ee493ccf8357b52e1061fe55/fail2ban_exporter_0.10.2_linux_amd64.tar.gz [following]
--2024-12-04 08:30:06--  https://gitlab.com/-/project/24199687/uploads/3487e012ee493ccf8357b52e1061fe55/fail2ban_exporter_0.10.2_linux_amd64.tar.gz
Reusing existing connection to [gitlab.com]:443.
HTTP request sent, awaiting response... 200 OK
Length: 3879499 (3.7M) [application/octet-stream]
Saving to: ‘fail2ban_exporter_0.10.2_linux_amd64.tar.gz'
=== end trace ===

Example Project

https://gitlab.com/hctrdev/fail2ban-prometheus-exporter/

go to the releases page and any file under the Other section of the 0.10.2 release

What is the current bug behavior?

double "/" in the 302 location url

What is the expected correct behavior?

not having a double "/" in the location url.

Relevant logs and/or screenshots

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

Results of GitLab application Check

Possible fixes

Edited by 🤖 GitLab Bot 🤖