Skip to content

Commit 00cef99

Browse files
committed
Prevent services from accidentally forgetting to set useInternalUrl
1 parent 69a1b29 commit 00cef99

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

src/corelib/ServiceEndpoint.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ public class ServiceEndpoint
2525
private readonly string _microversion;
2626
private readonly string _microversionHeader;
2727

28+
/// <summary>
29+
/// Initializes a new instance of the <see cref="ServiceEndpoint"/> class.
30+
/// </summary>
31+
/// <param name="serviceType">Type of the service.</param>
32+
/// <param name="authenticationProvider">The authentication provider.</param>
33+
/// <param name="region">The region.</param>
34+
/// <param name="useInternalUrl">Specifies if internal URLs should be used.</param>
35+
public ServiceEndpoint(IServiceType serviceType, IAuthenticationProvider authenticationProvider, string region, bool useInternalUrl)
36+
: this(serviceType, authenticationProvider, region, useInternalUrl, microversion: null, microversionHeader: null)
37+
{}
38+
2839
/// <summary>
2940
/// Initializes a new instance of the <see cref="ServiceEndpoint"/> class.
3041
/// </summary>
@@ -34,8 +45,8 @@ public class ServiceEndpoint
3445
/// <param name="useInternalUrl">Specifies if internal URLs should be used.</param>
3546
/// <param name="microversion">Specifies the microversion to send with each request.</param>
3647
/// <param name="microversionHeader">Specifies the header to use when setting the microversion.</param>
37-
public ServiceEndpoint(IServiceType serviceType, IAuthenticationProvider authenticationProvider, string region, bool useInternalUrl = false,
38-
string microversion = null, string microversionHeader = null)
48+
public ServiceEndpoint(IServiceType serviceType, IAuthenticationProvider authenticationProvider, string region, bool useInternalUrl,
49+
string microversion, string microversionHeader)
3950
{
4051
_serviceType = serviceType;
4152
_authenticationProvider = authenticationProvider;

0 commit comments

Comments
 (0)