Skip to content

Commit

Permalink
Make Options authority optional
Browse files Browse the repository at this point in the history
Signed-off-by: litt <austin@swirldslabs.com>
  • Loading branch information
litt committed Sep 17, 2024
1 parent 4d54f8b commit 4210c92
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import io.helidon.http.http2.StreamFlowControl;
import io.helidon.webserver.http2.spi.Http2SubProtocolSelector;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Delayed;
import java.util.concurrent.Flow;
Expand Down Expand Up @@ -196,7 +197,7 @@ public void init() {
// Create the "options" to make available to the ServiceInterface. These options are used to decide on the
// best way to parse or handle the request.
final var options = new Options(
headers.authority(), // the client (see http2 spec)
Optional.ofNullable(headers.authority()), // the client (see http2 spec)
contentType.equals(APPLICATION_GRPC_PROTO),
contentType.equals(APPLICATION_GRPC_JSON),
contentType);
Expand Down Expand Up @@ -562,7 +563,7 @@ public void onComplete() {
* Simple implementation of the {@link ServiceInterface.RequestOptions} interface.
*/
private record Options(
String authority,
Optional<String> authority,
boolean isProtobuf,
boolean isJson,
String contentType)
Expand Down

0 comments on commit 4210c92

Please sign in to comment.