newur opened a new pull request #11924: URL: https://github.com/apache/pulsar/pull/11924
### Motivation I want to develop an own frontend (SPA) for Pulsar, similar to Pulsar Manager. The frontend should be able to make REST calls directly to a (local) broker. Currently, this the browser blocks the requests, due to different origins for front- and backend (CORS policy). I know it could be worked around with a reverse proxy, but I would like to keep the setup simple. See also https://github.com/apache/pulsar-manager/issues/219 ### Modifications Add a servlet Filter that adds the required CORS headers, if allowedOrigins are configured. ### Verifying this change This change added tests and can be verified as follows: Since CORS is a security measure that requires a browser, I am not sure how this can be tested best in your CI. Would need some guidance on this. ### Does this pull request potentially affect one of the following parts: *If `yes` was chosen, please highlight the changes* - Dependencies (does it add or upgrade a dependency): no - The public API: no - The schema: no - The default values of configurations: no - value is empty by default - The wire protocol: no - The rest endpoints: no - The admin cli options: no - Anything that affects deployment: no ### Documentation Check the box below and label this PR (if you have committer privilege). Need to update docs? - [ x ] no-need-doc Looks like doc for ServiceConfiguration.class is generated from the annotation. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
