-
Notifications
You must be signed in to change notification settings - Fork 77
Description
Description
GET methods don’t work for MockResponsePlugin— the error “fail │ An error occurred in a plugin” appears. This issue occurs only in versions 1.2.0 and 1.3.0-beta.
When the same request is changed to POST and run via Fiddler, the mock response is returned successfully.
Version 1.1.0 works correctly.
Expected behaviour
req ╭ GET https://graph.microsoft.com/v1.0/users?$filter=mail%20eq%20%27TestUser0100%40da.com%27&$top=1
time │ 10/7/2025 10:12:53 PM +00:00
trce │ MockResponsePlugin: BeforeRequestAsync called
mock │ MockResponsePlugin: 200 https://graph.microsoft.com/v1.0/users*
trce │ RetryAfterPlugin: BeforeRequestAsync called
skip ╰ RetryAfterPlugin: Response already set
Actual behaviour
req ╭ GET https://graph.microsoft.com/v1.0/users?$filter=mail%20eq%20%27TestUser0100%40da.com%27&$top=1
time │ 10/7/2025 7:14:10 PM +00:00
trce │ MockResponsePlugin: BeforeRequestAsync called
trce │ MockResponsePlugin: ReplacePlaceholders called
fail │ An error occurred in a plugin
trce │ RetryAfterPlugin: BeforeRequestAsync called
skip │ RetryAfterPlugin: Request not throttled
trce │ RetryAfterPlugin: Left BeforeRequestAsync
pass ╰ Passed through
Steps to reproduce
- Install version 1.2.0. or 1.3.0-beta
- Update the configuration files as described in the “Configuration file” section.
- Run Dev Proxy with the following command:: '.\devproxy.exe -c devproxyrc.json --log-level trace'
- Open Fiddler and send a GET request to
https://graph.microsoft.com/v1.0/users?$filter=mail%20eq%20%27TestUser0100%40da.com%27&$top=1
A.R. (Actual Result): See the Actual Behaviour section above.
E.R. (Expected Result): See the Expected Behaviour section above. - Open the mock.json file and change
"method": "GET"
to"method": "POST"
- Send the same request again using POST https://graph.microsoft.com/v1.0/users?$filter=mail%20eq%20%27TestUser0100%40da.com%27&$top=1
A.R.
req ╭ POST https://graph.microsoft.com/v1.0/users?$filter=mail%20eq%20%27TestUser0100%40da.com%27&$top=1
time │ 10/7/2025 10:12:53 PM +00:00
trce │ MockResponsePlugin: BeforeRequestAsync called
mock │ MockResponsePlugin: 200 https://graph.microsoft.com/v1.0/users*
trce │ RetryAfterPlugin: BeforeRequestAsync called
skip ╰ RetryAfterPlugin: Response already set
Dev Proxy Version
1.2.0, 1.3.0-beta
Operating system (environment)
Windows
Shell
PowerShell
Configuration file
devproxyrc.json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v1.2.0/rc.schema.json",
"plugins": [
{
"name": "MockResponsePlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
"configSection": "mocksPlugin"
},
{
"name": "RetryAfterPlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll"
}
],
"urlsToWatch": [
"https://graph.microsoft.com/",
"https://login.microsoftonline.com/tenantId-test"
],
"mocksPlugin": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v1.2.0/mockresponseplugin.schema.json",
"mocksFile": "mocks.json"
},
"logLevel": "trace",
"newVersionNotification": "stable",
"showSkipMessages": true,
"showTimestamps": true,
"validateSchemas": true
}
mocks.json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v1.2.0/mockresponseplugin.mocksfile.schema.json",
"mocks": [
{
"request": {
"method": "GET",
"url": "https://graph.microsoft.com/v1.0/users*"
},
"response": {
"statusCode": 200,
"body": "@mocks/users.json"
}
}
]
}
users.json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users",
"value": [
{
"businessPhones": [],
"displayName": "Test User",
"givenName": null,
"jobTitle": null,
"mail": "testuser@test.com",
"mobilePhone": null,
"officeLocation": null,
"preferredLanguage": null,
"surname": null,
"userPrincipalName": "testuser@TEST.onmicrosoft.com",
"id": "tenantid-test-1111-1111-f42ed6b00000"
}
]
}
Additional Info
When the same request is changed to POST and run via Fiddler, the mock response is returned successfully.
Direct GET requests also don't work.
Version 1.1.0 works correctly.