Skip to content

Commit

Permalink
Fix presense in header x-media-version when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-suse committed Dec 12, 2024
1 parent bff930e commit 8da6d0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/MirrorCache/WebAPI/Plugin/Dir.pm
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ sub _add_etag {
} else {
$media_version = join(',', sort @versions);
}
$c->res->headers->add('X-MEDIA-VERSION' => $media_version);
$c->res->headers->add('X-MEDIA-VERSION' => $media_version) if $media_version;
}

sub _render_dir_local {
Expand Down
5 changes: 4 additions & 1 deletion t/environ/20-report-download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,14 @@ $mc/curl /rest/repdownload?group=mirror,country | grep '{"bytes_redirected":"396

$mc/curl -Is /download/repositories/home:/b1:/branches:/science:/EtherLab/Debian_Testing/arm64/libethercat_1.5.2-33_arm64.deb | grep 'X-MEDIA-VERSION: 1.5.2'


$mc/curl -Is /download/repositories/home:/b1:/branches:/science:/EtherLab/Debian_Testing/arm64/libethercat_1.5.2-33_arm64.deb | grep 'X-MEDIA-VERSION: 1.5.2'

$mc/curl -Is '/download/distribution/leap/15.3/repo/oss/noarch/?REGEX=.*\.noarch\..?rpm' | grep 'X-MEDIA-VERSION: 17.5.0,7.3.6.2'

rc=0
$mc/curl -Is /download/repositories/home:/b1:/branches:/science:/EtherLab/Debian_Testing/ | grep -i X-MEDIA-VERSION || rc=$?
test $rc -gt 0

$mc/curl '/rest/repdownload?group=country&os=ubuntu'
$mc/curl '/rest/repdownload?group=country,mirror&type=rpm'
$mc/curl "/rest/repdownload?group=project&mirror=$(ap7/print_address)"
Expand Down

0 comments on commit 8da6d0a

Please sign in to comment.