Max Cao

Results 56 comments of Max Cao

Should I be supporting multiple Accept headers like `Accept: text/html;application/json;*/*` ? I was originally going to but I realized since this is going to be an internally used endpoint, there...

Also seems that integration tests fail because of HTTP 406 as well, like [here](https://github.com/cryostatio/cryostat/runs/7142404727?check_suite_focus=true#step:8:1903)

Sounds good, so then if they don't provide any valid accept headers, should we still respond with HTML, or still 406?

I'm not sure why I am getting null pointer exceptions in my tests e.g. ``` @Test void shouldRespond406IfAcceptInvalid() throws Exception { when(authManager.validateHttpHeader(Mockito.any(), Mockito.any())) .thenReturn(CompletableFuture.completedFuture(true)); when(ctx.request()).thenReturn(req); when(ahp.parse(Mockito.any())).thenReturn(List.of("unacceptable")); when(ctx.response()).thenReturn(resp); when(resp.putHeader(Mockito.any(CharSequence.class), Mockito.any(CharSequence.class))) .thenReturn(resp);...

> > 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...

I just realized there's a function getAll() where I can call `ctx.request.headers().getAll(HttpHeaders.ACCEPT) ` :(

Wait, the `getAll()` doesn't actually parse the header into a List of strings, it just makes a List of one String which looks like `text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8` I guess I will just...

> If the `.contains("Accept", "text/html", true)` works then I think that's better, but I'm not sure if the values there are already parsed and split up for you or if...

I've added the ReportGetAcceptHeaderParser as a temporary class until #1016 is resolved. Also, I'm unsure of how to fix the ITs. I've tried just putting headers like boolean returnHtml =...

For some reason when I try to run the `./repeated-integration-tests.bash` , the server.log gives ``` Error: container cryostat-itest is not in pod cryostat-itests: no such container ``` I should be...