Skip to content

Commit 6981a5e

Browse files
namedgraphclaude
andcommitted
Add getMediaTypes() and getRequest() accessors to ProxyRequestFilter
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 91fb686 commit 6981a5e

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

src/main/java/com/atomgraph/linkeddatahub/server/filter/request/ProxyRequestFilter.java

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ else if (agentContext instanceof IDTokenSecurityContext idTokenSecurityContext)
143143
}
144144

145145
List<MediaType> readableMediaTypesList = new ArrayList<>();
146-
readableMediaTypesList.addAll(mediaTypes.getReadable(Model.class));
147-
readableMediaTypesList.addAll(mediaTypes.getReadable(ResultSet.class));
146+
readableMediaTypesList.addAll(getMediaTypes().getReadable(Model.class));
147+
readableMediaTypesList.addAll(getMediaTypes().getReadable(ResultSet.class));
148148
MediaType[] readableMediaTypesArray = readableMediaTypesList.toArray(MediaType[]::new);
149149

150150
if (log.isDebugEnabled()) log.debug("Proxying {} {} → {}", requestContext.getMethod(), requestContext.getUriInfo().getRequestUri(), targetURI);
@@ -259,11 +259,11 @@ protected Response getResponse(Response clientResponse, Response.StatusType stat
259259
protected Response getResponse(Model model, Response.StatusType statusType)
260260
{
261261
List<Variant> variants = com.atomgraph.core.model.impl.Response.getVariants(
262-
mediaTypes.getWritable(Model.class),
262+
getMediaTypes().getWritable(Model.class),
263263
getSystem().getSupportedLanguages(),
264264
new ArrayList<>());
265265

266-
return new com.atomgraph.core.model.impl.Response(request,
266+
return new com.atomgraph.core.model.impl.Response(getRequest(),
267267
model,
268268
null,
269269
new EntityTag(Long.toHexString(ModelUtils.hashModel(model))),
@@ -287,11 +287,11 @@ protected Response getResponse(ResultSetRewindable resultSet, Response.StatusTyp
287287
resultSet.reset();
288288

289289
List<Variant> variants = com.atomgraph.core.model.impl.Response.getVariants(
290-
mediaTypes.getWritable(ResultSet.class),
290+
getMediaTypes().getWritable(ResultSet.class),
291291
getSystem().getSupportedLanguages(),
292292
new ArrayList<>());
293293

294-
return new com.atomgraph.core.model.impl.Response(request,
294+
return new com.atomgraph.core.model.impl.Response(getRequest(),
295295
resultSet,
296296
null,
297297
new EntityTag(Long.toHexString(hash)),
@@ -312,4 +312,24 @@ public com.atomgraph.linkeddatahub.Application getSystem()
312312
return system;
313313
}
314314

315+
/**
316+
* Returns the media types registry.
317+
*
318+
* @return media types
319+
*/
320+
public MediaTypes getMediaTypes()
321+
{
322+
return mediaTypes;
323+
}
324+
325+
/**
326+
* Returns the JAX-RS request.
327+
*
328+
* @return request
329+
*/
330+
public Request getRequest()
331+
{
332+
return request;
333+
}
334+
315335
}

0 commit comments

Comments
 (0)