Skip to content

Commit

Permalink
Fix filters docs in wrong branch. Rename bom publication. Closes #6193
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskleeh committed Sep 22, 2021
1 parent f2e1d12 commit c40972b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ tasks.named("generateCatalogAsToml") {

publishing {
publications {
publication(MavenPublication) {
maven(MavenPublication) {
artifactId("micronaut-bom")
from components.javaPlatform
pom {
Expand Down
8 changes: 1 addition & 7 deletions src/main/docs/guide/httpServer/filters.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ The previous example demonstrates some key concepts such as executing logic in a

TIP: The examples use https://projectreactor.io[Project Reactor], however you can use any reactive framework that supports the Reactive streams specifications

The api:http.annotation.Filter[] annotation can use different styles of pattern for path matching by setting the `patternStyle` member. The supported options include Ant and Regex based matching.

By default, api:core.util.AntPathMatcher[] is used for path matching. When using Ant, the mapping matches URLs using the following rules:
The api:http.annotation.Filter[] annotation uses api:core.util.AntPathMatcher[] for path matching. The mapping matches URLs using the following rules:

* ? matches one character
* * matches zero or more characters
Expand All @@ -79,10 +77,6 @@ By default, api:core.util.AntPathMatcher[] is used for path matching. When using
|`customer/**/*.html`
|customer/index.html, customer/adam/profile.html, customer/adam/job/description.html

The other option is regular expression based matching. To use regular expressions, set `patternStyle = FilterPatternStyle.REGEX`. The `pattern` attribute is expected to contain a regular expression which will be expected to match the provided URLs exactly (using link:{jdkapi}/java/util/regex/Matcher.html#matches--[Matcher#matches]).

NOTE: Using Ant based matching is preferred because it's more performant than using regular expressions.

== Error States

The publisher returned from `chain.proceed` should never emit an error. In the cases where an upstream filter emitted an error or the route itself threw an exception, the error response should be emitted instead of the exception. In some cases it may be desirable to know the cause of the error response and for this purpose an attribute exists on the response if it was created as a result of an exception being emitted or thrown. The original cause is stored as the attribute api:http.HttpAttributes#EXCEPTION[].

0 comments on commit c40972b

Please sign in to comment.