-
Notifications
You must be signed in to change notification settings - Fork 141
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
Add subcollection options support for CORS preflight requests #495
Conversation
@miq-bot add_label wip |
@miq-bot add_label bug |
@miq-bot assign @abellotti |
looks good @jvlcek 👍 just the additional test when you get a chance. |
3d15086
to
5edf913
Compare
@miq-bot remove_label wip |
@abellotti and @gtanzillo I've made the requested Thank you for the input. JoeV |
spec/requests/tenant_quotas_spec.rb
Outdated
@@ -131,6 +131,12 @@ | |||
expect(response).to have_http_status(:no_content) | |||
end | |||
|
|||
it "supports OPTIONS requests on a subcollection without authorization" do | |||
options "/api/tenants/#{tenant.id}/quotas" |
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.
use the rails helper for building the url, api_tenant_quotas_url
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.
@abellotti OK will do. Thank you!
spec/requests/tenant_quotas_spec.rb
Outdated
@@ -131,6 +131,12 @@ | |||
expect(response).to have_http_status(:no_content) | |||
end | |||
|
|||
it "supports OPTIONS requests on a subcollection without authorization" do | |||
options api_tenant_quotas_url(:c_id => tenant.id) |
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.
I thought this was supposed to be api_tenant_quotas_url(nil, tenant)
look at other uses, like api_provider_flavors_url(nil, ems).
Checked commits jvlcek/manageiq-api@5edf913~...0e1240b with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Thanks @jvlcek for this API enhancement. LGTM!! 👍 |
Add subcollection options support for CORS prefilghted requests (cherry picked from commit 3502e51) https://bugzilla.redhat.com/show_bug.cgi?id=1599259
Hammer backport details:
|
Add subcollection options support for CORS prefilghted requests (cherry picked from commit 3502e51) https://bugzilla.redhat.com/show_bug.cgi?id=1646606
Gaprindashvili backport details:
|
https://bugzilla.redhat.com/show_bug.cgi?id=1599259
This PR adds support for the options verb on subcollections. This is needed to support
the prefilghted requests done by CORS.
To test this ensure the options verb responds successfully for subcollections
e.g.:
curl -X OPTIONS -k --user admin:<password> https://<API Server>/api/tenants/<id>/quotas