Skip to content

Commit 3ff8d64

Browse files
committed
Simplifying URI parsing
1 parent 99ddd34 commit 3ff8d64

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/WebJobs.Script/Binding/Http/HttpTriggerAttributeBindingProvider.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,9 @@ public async Task<ITriggerData> BindAsync(object value, ValueBindingContext cont
129129

130130
public static string ToInvokeString(HttpRequestMessage request)
131131
{
132-
string uri = request.RequestUri.AbsoluteUri;
133-
int idx = uri.IndexOf('?');
134-
if (idx != -1)
135-
{
136-
uri = uri.Substring(0, idx);
137-
}
132+
// For display in the Dashboard, we want to be sure we don't log
133+
// any sensitive portions of the URI (e.g. query params, headers, etc.)
134+
string uri = request.RequestUri?.GetLeftPart(UriPartial.Path);
138135

139136
return $"Method: {request.Method}, Uri: {uri}";
140137
}

0 commit comments

Comments
 (0)