Skip to content
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

[Subtask] Support the custom filters #1190

Closed
qqqttt123 opened this issue Dec 18, 2023 · 0 comments · Fixed by #1191
Closed

[Subtask] Support the custom filters #1190

qqqttt123 opened this issue Dec 18, 2023 · 0 comments · Fixed by #1191
Assignees

Comments

@qqqttt123
Copy link
Contributor

Describe the subtask

Support the custom filters

Parent issue

#1184

@qqqttt123 qqqttt123 self-assigned this Dec 19, 2023
jerryshao pushed a commit that referenced this issue Dec 21, 2023
### What changes were proposed in this pull request?
Add the support of custom filters referring to the Spark.

### Why are the changes needed?
Some filters can be configured by users, the needs of users are
different. Some filters are implemented by other libs.
For example, Jetty has implemented the CORS filter, so we supported
custom filters to satisfy the needs of users.

Fix: #1190

### Does this PR introduce _any_ user-facing change?

Yes, I have added the document.

### How was this patch tested?
test by the browser console
I test Jetty's cors filter.

Configuration 
```
gravitino.server.webserver.customFilters=org.eclipse.jetty.servlets.CrossOriginFilter
gravitino.server.webserver.org.eclipse.jetty.servlets.CrossOriginFilter.param.allowedOrigins=*
```

Browser console code
```
var http = new XMLHttpRequest();
var url = 'http://localhost:8090/api/version';
http.onreadystatechange = (e) => {
    console.log(http.responseText)
}
http.open("GET", url);
http.send();
```

---------

Co-authored-by: Heng Qin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant