KAFKA-3578: Allow cross origin HTTP requests on all HTTP methods#1288
KAFKA-3578: Allow cross origin HTTP requests on all HTTP methods#1288Ishiihara wants to merge 3 commits into
Conversation
| .header("Origin", origin) | ||
| .header("Access-Control-Request-Method", method) | ||
| .options(); | ||
| assertEquals(404, response.getStatus()); |
There was a problem hiding this comment.
The 404 seemed odd to me, so I want to make sure I understand why we're seeing it (since I would normally interpret that as an error). It seems that CORS doesn't require that you return a particular HTTP status code, so for the preflighted request it's actually ok if we return any code here. In the case of Jetty, it looks like the CrossOriginFilter's chainPreflight option defaults to true such that the OPTIONS request continues on for normal handling. Since we don't implement OPTIONS for any of our endpoints (and the one under test, specifically), we end up with a 404. Is that correct?
There was a problem hiding this comment.
That's correct. This is purely for testing purpose and making sure the Access-Control-Allow-Methods header is properly set.
|
@ewencp Addressed review comments. PTAL. |
|
LGTM, thanks! |
Author: Liquan Pei <liquanpei@gmail.com> Reviewers: Ewen Cheslack-Postava <ewen@confluent.io> Closes apache#1288 from Ishiihara/kip-56
* Use supplied Time instance to PersisterStateManager for fetching time information so that it is easily mocked. * Make Exponential backoff more configurable by dependency inversion of initial and max timeout ms. * Fixed big in max retries count.
No description provided.