Fill in OnSendingHeaders, Redirect, IsSecure.
This commit is contained in:
parent
ae9545a124
commit
cbd8401582
|
|
@ -1,4 +1,5 @@
|
|||
using System.IO;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.AspNet.Abstractions
|
||||
|
|
@ -16,6 +17,11 @@ namespace Microsoft.AspNet.Abstractions
|
|||
public abstract string ContentType { get; set; }
|
||||
|
||||
public abstract IResponseCookiesCollection Cookies { get; }
|
||||
|
||||
public abstract void OnSendingHeaders(Action<object> callback, object state);
|
||||
|
||||
public abstract void Redirect(string location);
|
||||
|
||||
public abstract Task WriteAsync(string data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ namespace Microsoft.AspNet.PipelineCore
|
|||
|
||||
public override bool IsSecure
|
||||
{
|
||||
get { throw new NotImplementedException(); }
|
||||
get { return string.Equals("https", Scheme, StringComparison.OrdinalIgnoreCase); }
|
||||
}
|
||||
|
||||
public override HostString Host
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System.Globalization;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -89,6 +90,18 @@ namespace Microsoft.AspNet.PipelineCore
|
|||
{
|
||||
get { return CanHasResponseCookies.Cookies; }
|
||||
}
|
||||
|
||||
public override void OnSendingHeaders(Action<object> callback, object state)
|
||||
{
|
||||
HttpResponseInformation.OnSendingHeaders(callback, state);
|
||||
}
|
||||
|
||||
public override void Redirect(string location)
|
||||
{
|
||||
HttpResponseInformation.StatusCode = 302;
|
||||
Headers.Set(Constants.Headers.Location, location);
|
||||
}
|
||||
|
||||
public override Task WriteAsync(string data)
|
||||
{
|
||||
var bytes = Encoding.UTF8.GetBytes(data);
|
||||
|
|
|
|||
Loading…
Reference in New Issue