use of org.webpieces.ctx.api.AcceptMediaType in project webpieces by deanhiller.
the class RequestStreamWriter method parseAccept.
private void parseAccept(Http2Headers req, RouterRequest routerRequest) {
List<AcceptType> types = headerParser.parseAcceptFromRequest(req);
List<AcceptMediaType> acceptedTypes = new ArrayList<>();
for (AcceptType t : types) {
if (t.isMatchesAllTypes())
acceptedTypes.add(new AcceptMediaType());
else if (t.isMatchesAllSubtypes())
acceptedTypes.add(new AcceptMediaType(t.getMainType()));
else
acceptedTypes.add(new AcceptMediaType(t.getMainType(), t.getSubType()));
}
routerRequest.acceptedTypes = acceptedTypes;
}
use of org.webpieces.ctx.api.AcceptMediaType in project webpieces by deanhiller.
the class RouterServiceImpl method parseAccept.
private void parseAccept(Http2Headers req, RouterRequest routerRequest) {
List<AcceptType> types = headerParser.parseAcceptFromRequest(req);
List<AcceptMediaType> acceptedTypes = new ArrayList<>();
for (AcceptType t : types) {
if (t.isMatchesAllTypes())
acceptedTypes.add(new AcceptMediaType());
else if (t.isMatchesAllSubtypes())
acceptedTypes.add(new AcceptMediaType(t.getMainType()));
else
acceptedTypes.add(new AcceptMediaType(t.getMainType(), t.getSubType()));
}
routerRequest.acceptedTypes = acceptedTypes;
}
Aggregations