@@ -105,24 +105,24 @@ public RequestProcessor processorForRequest(
105
105
LoggingContextSetter loggingContextSetter ,
106
106
Executor coreExecutor )
107
107
throws ProtocolException {
108
+ if (path .endsWith (HEALTH_PATH )) {
109
+ return new StaticResponseRequestProcessor (200 , "text/plain" , Slice .wrap ("OK" ));
110
+ }
111
+
112
+ // Verify request
113
+ if (endpoint .getRequestIdentityVerifier () != null ) {
114
+ try {
115
+ endpoint .getRequestIdentityVerifier ().verifyRequest (headersAccessor );
116
+ } catch (Exception e ) {
117
+ throw ProtocolException .unauthorized (e );
118
+ }
119
+ }
120
+
108
121
// Discovery request
109
122
if (path .endsWith (DISCOVER_PATH )) {
110
123
return this .handleDiscoveryRequest (headersAccessor );
111
124
}
112
125
113
- if (path .endsWith (HEALTH_PATH )) {
114
- return new StaticResponseRequestProcessor (
115
- 200 ,
116
- "text/plain" ,
117
- Slice .wrap (
118
- "Serving services ["
119
- + this .endpoint
120
- .getServiceDefinitions ()
121
- .map (ServiceDefinition ::getServiceName )
122
- .collect (Collectors .joining (", " ))
123
- + "]" ));
124
- }
125
-
126
126
// Parse request
127
127
String [] pathSegments = SLASH .split (path );
128
128
if (pathSegments .length < 3 ) {
@@ -152,15 +152,6 @@ public RequestProcessor processorForRequest(
152
152
throw ProtocolException .methodNotFound (serviceName , handlerName );
153
153
}
154
154
155
- // Verify request
156
- if (endpoint .getRequestIdentityVerifier () != null ) {
157
- try {
158
- endpoint .getRequestIdentityVerifier ().verifyRequest (headersAccessor );
159
- } catch (Exception e ) {
160
- throw ProtocolException .unauthorized (e );
161
- }
162
- }
163
-
164
155
// Parse OTEL context and generate span
165
156
final io .opentelemetry .context .Context otelContext =
166
157
this .endpoint
0 commit comments