Skip to content

Commit

Permalink
Excludes OPTIONS requests in Graph permissions plugins (#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
waldekmastykarz authored Jun 26, 2024
1 parent 66af639 commit b95642c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ private async Task AfterRecordingStop(object? sender, RecordingArgs e)

var methodAndUrlString = request.MessageLines.First();
var methodAndUrl = GetMethodAndUrl(methodAndUrlString);
if (methodAndUrl.method.Equals("OPTIONS", StringComparison.OrdinalIgnoreCase))
{
continue;
}

var requestsFromBatch = Array.Empty<(string method, string url)>();

var uri = new Uri(methodAndUrl.url);
Expand Down
4 changes: 4 additions & 0 deletions dev-proxy-plugins/RequestLogs/MinimalPermissionsPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ private async Task AfterRecordingStop(object? sender, RecordingArgs e)

var methodAndUrlString = request.MessageLines.First();
var methodAndUrl = GetMethodAndUrl(methodAndUrlString);
if (methodAndUrl.method.Equals("OPTIONS", StringComparison.OrdinalIgnoreCase))
{
continue;
}

var uri = new Uri(methodAndUrl.url);
if (!ProxyUtils.IsGraphUrl(uri))
Expand Down

0 comments on commit b95642c

Please sign in to comment.