-
Notifications
You must be signed in to change notification settings - Fork 866
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
Fix #1740: Handle OPTIONS in management API #1774
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1774 +/- ##
=========================================
Coverage ? 45.38%
=========================================
Files ? 64
Lines ? 2591
Branches ? 60
=========================================
Hits ? 1176
Misses ? 1415
Partials ? 0 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
openApi.addPath("/models/{model_name}", getModelManagerPath(false)); | ||
openApi.addPath("/models/{model_name}/{model_version}", getModelManagerPath(true)); | ||
openApi.addPath("/models/{model_name}/{model_version}/set-default", getSetDefaultPath()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
listManagementApis can be applied here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
listManagementApis has 6 paths:
/
/models
/models/{model_name}
/models/{model_name}/{model_version}
/models/{model_name}/{model_version}/set-default
/api-description
Here because it's only listing for specific model, it has only 3 paths:
/models/{model_name}
/models/{model_name}/{model_version}
/models/{model_name}/{model_version}/set-default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a unit test case as well
Hi Aaqib, I have added unit tests. |
Description
Please read our CONTRIBUTING.md prior to creating your first pull request.
Please include a summary of the feature or issue being fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
This is to fix #1740.
The cause is that the browser (tested Firefox, Chrome and Safari) was using OPTIONS to do a preflight check before PUT and DELETE request.
TS code currently doesn't handle OPTIONS for management API and will throw MethodNotAllowedException.
Fixes #1740
Type of change
Please delete options that are not relevant.
Feature/Issue validation/testing
Please describe the Unit or Integration tests that you ran to verify your changes and relevant result summary. Provide instructions so it can be reproduced.
Please also list any relevant details for your test configuration.
Logs for Test A
Before the fix the CORS DELETE / PUT requests failed with:
CORS Preflight Did Not Succeed
After the fix the CORS requests succeeded.
Logs for Test B
Checklist: