-
-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated mapping is not being picked and responded with the response #73
Comments
@StefH I have found the solution for this. If I could create the pull request, then you can look into the fix and approve. |
You can make a PR and check if the unit-tests still work fine and maybe check if more tests are needed to test this scenario. |
All the tests are working fine. |
You can just fork this project and do your change and create a PR. |
@StefH yes done. |
Thanks. See new NuGet. |
Start the FluentMockServer with below settings
Now access /__admin/mappings to get the default mappings in the console application example (having guid 11111110-a633-40e8-a244-5cb80bc0ab66).
Update the pattern to /static/mapping/update
Once the mapping is updated, make a get call to localhost:1111/static/mapping/update, this will return 410 as response.
Possible issue found is when we try to find the matching mappings from the list of mappings we have. In WireMockMiddleWire.cs file in Invoke method we have a condition to to check if it's partial mappings or not. In the else loop, we are sorting the mapping object by priority and then return the IsPerfectMatch first or default value. Here we are finding another mapping with matches the above pattern with /* which is being registered when we add ProxyAndRecordSettings. So when we try to access localhost:1111/static/mapping/update it matches with /* and return 410 rather finding the other matches in the mapping.
If we can parse all the entries in the mappings object we should find the exact match for /static/mapping/update pattern also. Infact we can see in the mappings object and also the value of IsPerfectMatch being set to this result as true, but the first value which matches the pattern /* is being returned.
The text was updated successfully, but these errors were encountered: