1 write to Response
Microsoft.AspNetCore.Server.HttpSys (1)
RequestProcessing\RequestContext.FeatureCollection.cs (1)
122
Response
= new Response(this);
66 references to Response
Microsoft.AspNetCore.Server.HttpSys (66)
AuthenticationHandler.cs (2)
26
_requestContext!.
Response
.StatusCode = 401;
32
_requestContext!.
Response
.StatusCode = 403;
AuthenticationManager.cs (3)
181
IList<string> challenges = GenerateChallenges(context.
Response
.AuthenticationChallenges);
185
context.
Response
.Headers[HeaderNames.WWWAuthenticate]
186
= StringValues.Concat(context.
Response
.Headers[HeaderNames.WWWAuthenticate], challenges.ToArray());
RequestProcessing\Request.cs (1)
399
public bool CanDelegate => !(HasRequestBodyStarted || RequestContext.
Response
.HasStarted);
RequestProcessing\RequestContext.cs (14)
47
if (_disposed ||
Response
.BodyIsFinished)
97
if (
Response
.HasStarted)
103
Response
.StatusCode = StatusCodes.Status101SwitchingProtocols;
104
Response
.ReasonPhrase = HttpReasonPhrase.Get(StatusCodes.Status101SwitchingProtocols);
106
Response
.SendOpaqueUpgrade(); // TODO: Async
108
Response
.SwitchToOpaqueMode();
109
var opaqueStream = new OpaqueStream(Request.Body,
Response
.Body);
131
Response
.Dispose();
178
Response
?.Abort();
212
Response
?.CancelLastWrite();
281
Response
.StatusCode = status;
282
Response
.ContentLength = 0;
292
if (
Response
.HasStarted)
326
Response
.MarkDelegated();
RequestProcessing\RequestContext.FeatureCollection.cs (14)
141
_responseStream = new ResponseStream(
Response
.Body, OnResponseStart);
142
_responseHeaders =
Response
.Headers;
477
get { return
Response
.ReasonPhrase; }
478
set {
Response
.ReasonPhrase = value; }
483
get { return
Response
.StatusCode; }
484
set {
Response
.StatusCode = value; }
490
await
Response
.SendFileAsync(path, offset, length, cancellation);
523
Response
.Dispose();
613
get => _responseTrailers ??=
Response
.Trailers;
631
Response
.Headers.IsReadOnly = true; // Prohibit further modifications.
658
Response
.CacheTtl = GetCacheTtl();
664
var response =
Response
;
751
if (!
Response
.HasStarted)
753
Response
.Headers[HeaderNames.Connection] = "close";
RequestProcessing\RequestContextOfT.cs (5)
71
if (
Response
.HasStarted)
89
Response
.Headers.IsReadOnly = false;
90
Response
.Trailers.IsReadOnly = false;
91
Response
.Headers.Clear();
92
Response
.Trailers.Clear();
RequestProcessing\Response.cs (1)
403
var statusCanHaveBody = CanSendResponseBody(RequestContext.
Response
.StatusCode);
RequestProcessing\ResponseBody.cs (26)
121
var started = _requestContext.
Response
.HasStarted;
150
statusCode = _requestContext.
Response
.SendHeaders(ref allocator, dataChunks, null, flags, false);
193
var chunked = _requestContext.
Response
.BoundaryType == BoundaryType.Chunked;
194
var addTrailers = endOfRequest && _requestContext.
Response
.HasTrailers;
265
_requestContext.
Response
.SerializeTrailers(ref allocator, out dataChunks[currentChunk++]);
269
_requestContext.
Response
.MakeTrailersReadOnly();
327
var started = _requestContext.
Response
.HasStarted;
343
var chunked = _requestContext.
Response
.BoundaryType == BoundaryType.Chunked;
352
statusCode = _requestContext.
Response
.SendHeaders(ref allocator, null, asyncResult, flags, false);
465
if (!_requestContext.
Response
.HasComputedHeaders)
467
flags = _requestContext.
Response
.ComputeHeaders(writeCount, endOfRequest);
475
else if (_requestContext.
Response
.BoundaryType == BoundaryType.ContentLength)
477
_leftToWrite = _requestContext.
Response
.ExpectedBodyLength;
485
if (endOfRequest && _requestContext.
Response
.BoundaryType == BoundaryType.Close)
490
&& (_leftToWrite != writeCount || _requestContext.
Response
.TrailersExpected))
508
if (_leftToWrite == 0 && !_requestContext.
Response
.TrailersExpected)
511
_requestContext.
Response
.MakeTrailersReadOnly();
528
if (count == 0 && _requestContext.
Response
.HasStarted)
550
var contentLength = _requestContext.
Response
.ContentLength;
552
if (!_requestContext.
Response
.HasComputedHeaders && contentLength < count)
557
else if (_requestContext.
Response
.HasComputedHeaders && _requestContext.
Response
.BoundaryType == BoundaryType.ContentLength
580
if (count == 0 && _requestContext.
Response
.HasStarted)
620
var started = _requestContext.
Response
.HasStarted;
666
var chunked = _requestContext.
Response
.BoundaryType == BoundaryType.Chunked;
674
statusCode = _requestContext.
Response
.SendHeaders(ref allocator, null, asyncResult, flags, false);