mirror of
https://github.com/apple/pkl.git
synced 2026-06-29 08:46:22 +02:00
Replace magic test port 12110 with 0 (#345)
Also introduce constants for some test package SHAs to make them easier to update.
This commit is contained in:
@@ -111,8 +111,8 @@ public interface HttpClient extends AutoCloseable {
|
||||
/**
|
||||
* Sets a test server's listening port.
|
||||
*
|
||||
* <p>If set, requests that specify port 12110 will be modified to use the given port. This is
|
||||
* an internal test option.
|
||||
* <p>If set, requests that specify port 0 will be modified to use the given port. This is an
|
||||
* internal test option.
|
||||
*/
|
||||
Builder setTestPort(int port);
|
||||
|
||||
|
||||
@@ -105,9 +105,7 @@ final class RequestRewritingClient implements HttpClient {
|
||||
}
|
||||
|
||||
private URI rewriteUri(URI uri) {
|
||||
// Would be nice to use port 0 instead of 12110,
|
||||
// but this is best done in a separate commit.
|
||||
if (testPort != -1 && uri.getPort() == 12110) {
|
||||
if (testPort != -1 && uri.getPort() == 0) {
|
||||
return HttpUtils.setPort(uri, testPort);
|
||||
}
|
||||
return uri;
|
||||
|
||||
Reference in New Issue
Block a user