Skip to content

Commit

Permalink
Merge of #642. Thanks @andregouveia8
Browse files Browse the repository at this point in the history
  • Loading branch information
jansenbe committed Jun 8, 2022
1 parent f758cf3 commit dcaa3b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/lib/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Extend timeouts and add retries to teams provisioning #669 [patrikhellgren - Patrik Hellgren]
- Implement show / hide of site title in header using SetChromeOptions #670 [eduardpaul - Eduard Paul]
- Improve folder creation in EnsureFolderPath method #673 [gautamdsheth - Gautam Sheth]
- Add UserAgent to CSOM based access token retrieval in GetAccessToken #642 [andregouveia8 - André Gouveia]

## [1.9.0]

Expand Down
5 changes: 1 addition & 4 deletions src/lib/PnP.Framework/Extensions/ClientContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -666,10 +666,7 @@ public static string GetAccessToken(this ClientRuntimeContext clientContext)
accessToken = authorization.Replace("Bearer ", string.Empty);
}

if (!string.IsNullOrWhiteSpace(userAgentFromConfig))
{
e.WebRequestExecutor.WebRequest.Headers.Add("User-Agent", userAgentFromConfig);
}
e.WebRequestExecutor.WebRequest.UserAgent = string.IsNullOrEmpty(userAgentFromConfig) ? $"{PnPCoreUtilities.PnPCoreUserAgent}" : userAgentFromConfig;
};
// Issue a dummy request to get it from the Authorization header
clientContext.ExecutingWebRequest += handler;
Expand Down

0 comments on commit dcaa3b6

Please sign in to comment.