Andrew Azores
Andrew Azores
I'll leave that up to you. I would prefer the 406 for now, and then the proper `.produces()` content-routing later will properly implement the negotiation and possibly change that behaviour...
> Caused by: java.lang.NullPointerException: Cannot invoke "io.vertx.ext.web.ParsedHeaderValues.accept()" because the return value of "io.vertx.ext.web.RoutingContext.parsedHeaders()" is null I think this is saying that `ctx.parsedHeaders()` returning null is causing the chained `.accept()` call...
```java ParsedHeaderValues phv = Mockito.mock(ParsedHeaderValues.class); Mockito.when(ctx.parsedHeaders()).thenReturn(phv); Mockito.when(phv.accept()).thenReturn(List.of(something, orOther)); ``` > I was trying to avoid mocking ParsedHeaderValues because I don't know how to instantiate it, but I'll try digging more....
Yep. The return type of `.headers()` is a [MultiMap](https://vertx.io/docs/apidocs/io/vertx/core/MultiMap.html). We use that in various places already, ex.: https://github.com/cryostatio/cryostat/blob/main/src/test/java/io/cryostat/net/web/http/api/v2/AuthPostHandlerTest.java
I think you could even use `.headers().contains("Accept", "text/html", true)` as a replacement for the new "parser" class.
What about something like: ```java ParsedHeaderValues phv = ctx.parsedHeaders(); List accept = phv.accept(); boolean returnHtml = accept.stream().anyMatch(header -> header.component().equals("text") && header.subComponent().equals("html")) ``` If the `.contains("Accept", "text/html", true)` works then I...
> `header -> header.component().equals("text") && (header.subComponent().equals("html") || header.subComponent().equals("*"));)` Seems like that's encoding the expected behaviour.
`500` generally indicates that something is broken and throwing an uncaught exception within Cryostat itself, not in the test process. You can do `podman logs -f cryostat-itest` to watch the...
Okay, that's fine. I've marked this PR as depending on that task so that we don't lose track.
`quay.io/andrewazores/cryostat:k8s-userinfo-2` has the `user:info` scope added. I don't get the log exception anymore, but logging in just loops back to the cluster SSO page now.