Skip to content

Commit 28e649d

Browse files
committed
Log updated request url with -Debug.
1 parent 917a8e4 commit 28e649d

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/Authentication/Authentication/ErrorConstants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ internal static class Message
2828
internal const string ExpiredUserProvidedToken = "The provided access token has expired. Set a valid access token to `-{0}` parameter and try again.";
2929
internal const string InvalidUrlParameter = "Parameter '{0}' has an invalid endpoint URL. Please use a valid URL with a network protocol i.e. [protocol]://[resource-name].";
3030
internal const string InvalidNationalCloud = "Parameter `{0}` has an invalid national cloud. Use Get-MgEnvironment to get a list of valid national clouds.";
31-
internal const string InvalidEnvironment = "Unable to find environment with name '{0}'.";
31+
internal const string InvalidEnvironment = "Unable to find environment with name '{0}'. Use Get-MgEnvironment to list available environments.";
3232
internal const string CannotAccessFile = "Could not {0} file at '{1}'. Please ensure you have access to this file and try again in a few minutes..";
3333
internal const string CannotModifyBuiltInEnvironment = "Cannot {0} built-in environment {1}.";
3434
}

src/Authentication/Authentication/Helpers/HttpMessageFormatter.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ private static void SerializeRequestLine(StringBuilder message, HttpRequestMessa
245245
private static void SerializeStatusLine(StringBuilder message, HttpResponseMessage httpResponse)
246246
{
247247
Contract.Assert(message != null, "message cannot be null");
248+
message.Append(httpResponse.RequestMessage?.Method + SP);
249+
message.Append(httpResponse.RequestMessage?.RequestUri.AbsoluteUri + CRLF);
248250
message.Append($"HTTP/{(httpResponse.Version != null ? httpResponse.Version.ToString(2) : "1.1")}{SP}");
249251
message.Append((int) httpResponse.StatusCode + SP);
250252
message.Append(httpResponse.ReasonPhrase + CRLF);

tools/Custom/HttpMessageFormatter.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ private static void SerializeRequestLine(StringBuilder message, HttpRequestMessa
265265
private static void SerializeStatusLine(StringBuilder message, HttpResponseMessage httpResponse)
266266
{
267267
Contract.Assert(message != null, "message cannot be null");
268+
message.Append(httpResponse.RequestMessage?.Method + SP);
269+
message.Append(httpResponse.RequestMessage?.RequestUri.AbsoluteUri + CRLF);
268270
message.Append($"HTTP/{(httpResponse.Version != null ? httpResponse.Version.ToString(2) : "1.1")}{SP}");
269271
message.Append((int)httpResponse.StatusCode + SP);
270272
message.Append(httpResponse.ReasonPhrase + CRLF);

0 commit comments

Comments
 (0)