Skip to content

Commit

Permalink
try to fix scala/java issue with CORS page (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning authored Dec 28, 2023
1 parent 18aa9d3 commit a33131d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/src/main/paradox/common/cors.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ val route: Route = cors() {
}
```
@@@

@@@ div { .group-java }
```java
import static org.apache.pekko.http.cors.javadsl.CorsDirectives.*;
Expand All @@ -39,6 +40,7 @@ final Route route = cors(() -> {
@@@

The settings can be updated programmatically too.

@@@ div { .group-scala }
```scala
val settings = CorsSettings(...).withAllowGenericHttpRequests(false)
Expand All @@ -47,6 +49,7 @@ val strictRoute: Route = cors(settings) {
}
```
@@@

@@@ div { .group-java }
```java
final CorsSettings settings = CorsSettings.create(...).withAllowGenericHttpRequests(false);
Expand Down

0 comments on commit a33131d

Please sign in to comment.