Use Product user-agent standardized formatting

This commit is contained in:
Erik C. Thauvin 2026-06-23 22:41:44 -07:00
parent cd545df730
commit 462e8fc10a
No known key found for this signature in database
GPG key ID: 776702A6A2DA330E
3 changed files with 5 additions and 3 deletions

2
core

@ -1 +1 @@
Subproject commit fa567721c00d99626ed439db4f0340eadff0ec03
Subproject commit 5f977636531d1b978b762a615d720097baa37830

View file

@ -6,6 +6,8 @@ package rife.bld.dependencies;
import rife.bld.BldVersion;
import rife.tools.FileUtils;
import rife.tools.HttpUtils;
import rife.tools.Product;
import rife.tools.exceptions.FileUtilsErrorException;
import java.io.File;
@ -191,7 +193,7 @@ public abstract class ArtifactRetriever {
private static URLConnection openUrlConnection(RepositoryArtifact artifact) throws IOException {
var connection = new URL(artifact.location()).openConnection();
connection.setUseCaches(false);
connection.setRequestProperty("User-Agent", "bld " + BldVersion.getVersion());
connection.setRequestProperty(HttpUtils.HEADER_USER_AGENT, Product.BLD.toUserAgent(BldVersion.getVersion()));
return connection;
}

View file

@ -830,7 +830,7 @@ public class Wrapper {
throws IOException {
var connection = url.openConnection();
connection.setUseCaches(false);
connection.setRequestProperty("User-Agent", "bld " + version);
connection.setRequestProperty(HttpUtils.HEADER_USER_AGENT, Product.BLD.toUserAgent(version));
try (var in = connection.getInputStream()) {
return new String(in.readAllBytes(), StandardCharsets.UTF_8);
}