-
Notifications
You must be signed in to change notification settings - Fork 183
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
[http-fault-injector] Add support for interrupting request #7698
[http-fault-injector] Add support for interrupting request #7698
Conversation
- Should handle chunked upstream requests without content-length - And shouldn't break requests with no body
- Default buffer size is about 3MB, which is too large for 10MB payload
This reverts commit d9b497c.
@@ -67,13 +67,10 @@ private async Task<UpstreamResponse> SendUpstreamRequest(HttpRequest request, st | |||
|
|||
using (var upstreamRequest = new HttpRequestMessage(new HttpMethod(request.Method), upstreamUri)) | |||
{ | |||
if (request.ContentLength > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should work even for requests with no body, or requests with chunked encoding. Shouldn't need to gate on content-length header.
@@ -13,6 +13,8 @@ RUN dotnet dev-certs https | |||
EXPOSE 7777 | |||
EXPOSE 7778 | |||
|
|||
ENV ASPNETCORE_URLS=http://+:7777;https://+:7778 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are already set in appsettings.json
, but when we tried to run the docker container, it ws using the default ports of 5000 and 5001 instead. This seems like a reasonable setting if we want to ensure ASP.NET uses these ports.
@lmolkova: I'd like for you to review this before I merge. |
}) | ||
.Configure(app => app.Run(async context => | ||
{ | ||
Console.WriteLine($"Request: {context.Request.Path}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can still do app.UseHttpLogging()
to have logging configurable, controllable and exportable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The changes under
Azure.Sdk.Tools.HttpFaultInjector
deserve more scrutiny. The changes undersample-[clients|servers]
need less scrutiny since they are just samples.