Skip to content

Conversation

@peombwa
Copy link
Member

@peombwa peombwa commented Mar 29, 2022

This PR fixes #980 by falling back to OnBeforeCall event handler when -Debug is used in PS 5.1.

Root cause of the bug

In PS 5.1 (NET Framework 4.x), the requestMessage content was being disposed before we could access it in the OnResponseCreated event handler. We need to log the request object in the OnResponseCreated to retrieve the request headers set via the middleware pipeline.

Fix

  1. In PS 5.1 (.NET Framework), log the request message object in the OnBeforeCall event handler.
  2. In PS 6+ (NET Core, NET 5+), log the request message object in the OnResponseCreated event handle.

timayabi2020
timayabi2020 previously approved these changes Mar 30, 2022
@peombwa peombwa merged commit a91325c into dev Apr 11, 2022
@peombwa peombwa deleted the bugFixes/PS51Debug branch April 11, 2022 15:19
@peombwa peombwa mentioned this pull request Apr 11, 2022
peombwa added a commit that referenced this pull request Apr 11, 2022
* Weekly OpenApiDocs Download (#1136)

* Weekly OpenApiDocs Download. [run ci]

* Add generated MgCommandMetadata.json. [run ci]

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>

* Create projectsbot.yml

Adds a yaml file for adding issues to the project board

* Docs Generation (#1138)

* Weekly OpenApiDocs Download. [run ci]

* Add generated MgCommandMetadata.json. [run ci]

* Docs Generation for Devices.CloudPrint [run ci]

* Docs Generation for Devices.CorporateManagement [run ci]

* Docs Generation for DeviceManagement.Enrolment [run ci]

* Docs Generation for Users.Functions [run ci]

* Docs Generation for Files [run ci]

* Docs Generation for Identity.Governance [run ci]

* Docs Generation for CrossDeviceExperiences [run ci]

* Docs Generation for Identity.SignIns [run ci]

* Docs Generation for DirectoryObjects [run ci]

* Docs Generation for ChangeNotifications [run ci]

* Docs Generation for Bookings [run ci]

* Docs Generation for Identity.DirectoryManagement [run ci]

* Docs Generation for Education [run ci]

* Docs Generation for Users [run ci]

* Docs Generation for Sites [run ci]

* Docs Generation for Users.Actions [run ci]

* Docs Generation for DeviceManagement [run ci]

* Docs Generation for Teams [run ci]

* Docs Generation for Security [run ci]

* Docs Generation for Groups [run ci]

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>
Co-authored-by: Peter Ombwa <peombwa@microsoft.com>

* Weekly OpenApiDocs Download (#1151)

* Weekly OpenApiDocs Download. [run ci]

* Add generated MgCommandMetadata.json. [run ci]

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>

* Docs Generation (#1152)

* Weekly OpenApiDocs Download. [run ci]

* Add generated MgCommandMetadata.json. [run ci]

* Docs Generation for DeviceManagement.Functions [run ci]

* Docs Generation for Identity.SignIns [run ci]

* Docs Generation for Education [run ci]

* Docs Generation for Devices.CloudPrint [run ci]

* Docs Generation for Compliance [run ci]

* Docs Generation for Users.Functions [run ci]

* Docs Generation for Devices.CorporateManagement [run ci]

* Docs Generation for Files [run ci]

* Docs Generation for Groups [run ci]

* Docs Generation for Users.Actions [run ci]

* Docs Generation for Identity.Governance [run ci]

* Docs Generation for Security [run ci]

* Docs Generation for ChangeNotifications [run ci]

* Docs Generation for DeviceManagement.Enrolment [run ci]

* Docs Generation for DeviceManagement.Actions [run ci]

* Docs Generation for Sites [run ci]

* Docs Generation for Applications [run ci]

* Docs Generation for Users [run ci]

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>
Co-authored-by: Peter Ombwa <peombwa@microsoft.com>

* Chnage build agent. (#1157)

* Weekly OpenApiDocs Download (#1170)

* Weekly OpenApiDocs Download. [run ci]

* Add generated MgCommandMetadata.json. [run ci]

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>

* Update Get-MgApplication.md (#1160)

Examples 4 and 5 had users in the description. Corrected that to applications.

Co-authored-by: Peter Ombwa <peombwa@microsoft.com>

* Docs Generation (#1172)

* Weekly OpenApiDocs Download. [run ci]

* Add generated MgCommandMetadata.json. [run ci]

* Docs Generation for CloudCommunications [run ci]

* Docs Generation for Files [run ci]

* Docs Generation for Users.Actions [run ci]

* Docs Generation for Identity.DirectoryManagement [run ci]

* Docs Generation for Devices.CorporateManagement [run ci]

* Docs Generation for DeviceManagement.Functions [run ci]

* Docs Generation for Identity.SignIns [run ci]

* Docs Generation for Reports [run ci]

* Docs Generation for DeviceManagement.Administration [run ci]

* Docs Generation for Sites [run ci]

* Docs Generation for Education [run ci]

* Docs Generation for Users.Functions [run ci]

* Docs Generation for DeviceManagement [run ci]

* Docs Generation for Identity.Governance [run ci]

* Docs Generation for Applications [run ci]

* Docs Generation for Groups [run ci]

* Docs Generation for Users [run ci]

* Docs Generation for Teams [run ci]

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>
Co-authored-by: Peter Ombwa <peombwa@microsoft.com>

* Weekly OpenApiDocs Download (#1180)

* Weekly OpenApiDocs Download. [run ci]

* Add generated MgCommandMetadata.json. [run ci]

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>

* Docs Generation (#1181)

* Weekly OpenApiDocs Download. [run ci]

* Add generated MgCommandMetadata.json. [run ci]

* Docs Generation for Identity.DirectoryManagement [run ci]

* Docs Generation for Teams [run ci]

* Docs Generation for Applications [run ci]

* Docs Generation for Devices.CorporateManagement [run ci]

* Docs Generation for Compliance [run ci]

* Docs Generation for Files [run ci]

* Docs Generation for Identity.SignIns [run ci]

* Docs Generation for Sites [run ci]

* Docs Generation for Groups [run ci]

* Docs Generation for Search [run ci]

* Docs Generation for Users.Functions [run ci]

* Docs Generation for Users.Actions [run ci]

* Docs Generation for Education [run ci]

* Docs Generation for Identity.Governance [run ci]

* Docs Generation for Users [run ci]

* Docs Generation for DeviceManagement [run ci]

* Docs Generation for Security [run ci]

* Docs Generation for Devices.CloudPrint [run ci]

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>
Co-authored-by: Peter Ombwa <peombwa@microsoft.com>

* Enable Test-MgGroupDynamicMembershipRule command. (#1142)

* supress Invoke-MgFilterEntitlementManagementCatalogAccessPackage (#1190)

Co-authored-by: Peter Ombwa <peombwa@microsoft.com>

* add to beta profile (#1189)

Co-authored-by: Peter Ombwa <peombwa@microsoft.com>

* Fixes Missing `-Debug` Request Body in PS 5.1 (#1179)

* Fall back to OnBeforeCall in PS 5.1.

* Add Pester tests.

* Use PSHostVersion to detect PS edition.

* Reuse session HTTP client. (#1184)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>
Co-authored-by: DeVere Dyett <ddyett@microsoft.com>
Co-authored-by: K N Manoj Reddy <44399320+ManojReddy-MSFT@users.noreply.github.com>
Co-authored-by: Mark Wahl <mwahl@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Body of request is not shown in debug

4 participants