Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose styx service providers in admin interface #505

Merged

Conversation

chrisgresty
Copy link
Contributor

@chrisgresty chrisgresty commented Oct 25, 2019

See Issue #494

Copy link
Contributor

@dvlato dvlato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! 👍 I've left very minor comments only.

HttpResponse response = Mono.from(handler.handle(request, HttpInterceptorContext.create())).block();

assertThat(response.status(), equalTo(HttpResponseStatus.NO_CONTENT));
assertThat(response.contentLength().get(), equalTo(0L));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't particularly like the Exception message when we call get() on an optional. Maybe we could have a nicer assertion message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps assert isPresent() beforehand?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, actually it seems a NO_CONTENT response should not have a content-length header at all, even one set to 0. So I'll fix that, and check for its absence.
https://tools.ietf.org/html/rfc7230#section-3.3.2

A server MUST NOT send a Content-Length header field in any response
with a status code of 1xx (Informational) or 204 (No Content).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we intentionally let it have "Content-Length: 0" here as it seems otherwise the client was getting 'Transfer-Encoding: chunked' otherwise and that broke everything apart. If I recall correctly, we thought the header was added by Netty but we didn't really verify it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a quick check of the running server, I didn't get a Transfer-Encoding: chunked header when a zero-content response was returned. Maybe the admin server's netty is set up differently to the main proxy server?

@chrisgresty chrisgresty merged commit fc70227 into ExpediaGroup:master Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants