Skip to content

Commit 0632b43

Browse files
committed
Permit access to all mirrors if the list of allowed mirrors is empty
The list of allowed mirrors is empty by default, making apt-cacher-rs unusable in the default configuration. Therefore, this commit changes the behavior to allow access to all mirrors if the list is empty.
1 parent 06b2eea commit 0632b43

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Diff for: apt-cacher-rs.conf

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#aliases = []
5050

5151
# List of allowed mirrors.
52+
# If no mirrors are listed no restrictions are applied.
5253
# Example:
5354
# allowed_mirrors = [ 'deb.debian.org' ]
5455
#allowed_mirrors = []

Diff for: src/main.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1490,6 +1490,10 @@ enum CacheFileStat<'a> {
14901490
}
14911491

14921492
fn is_host_allowed(requested_host: &str) -> bool {
1493+
if global_config().allowed_mirrors.is_empty() {
1494+
return true;
1495+
}
1496+
14931497
global_config()
14941498
.allowed_mirrors
14951499
.iter()

0 commit comments

Comments
 (0)