Exemplo n.º 1
0
 /// <summary>
 /// This method supports the framework directly and should not be used from your code
 /// </summary>
 /// <param name="handler">The handler.</param>
 /// <param name="context">The context.</param>
 /// <param name="status">The <see cref="Status"/> returned by the Handler.</param>
 /// <returns></returns>
 public static bool Impl(IMayRedirect handler, IContext context, Status status)
 {
     if ((status.Code >= 301 && status.Code <= 303) || status.Code == 307)
     {
         context.Response.SetHeader("Location", handler.Location);
         return false;
     }
     return true;
 }
Exemplo n.º 2
0
        /// <summary>
        /// This method supports the framework directly and should not be used from your code
        /// </summary>
        /// <param name="handler">The handler.</param>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public static bool Impl(IMayRedirect handler, IContext context)
        {
            if ((context.Response.StatusCode >= 301 && context.Response.StatusCode <= 303) || context.Response.StatusCode == 307)
            {
                context.Response.SetHeader("Location", handler.Location);
				context.Response.SetCookie("Test", "Cookie");
                return false; // this cancels the responder task, so doesn't require a view. Cookie task MUST come before this!
            }
            return true;
        }
Exemplo n.º 3
0
        /// <summary>
        /// This method supports the framework directly and should not be used from your code
        /// </summary>
        /// <param name="handler">The handler.</param>
        /// <param name="context">The context.</param>
        /// <returns><c>false</c> (to prevent response output) if the status is a redirect code; otherwise, <c>true</c>.</returns>
        public static bool Impl(IMayRedirect handler, IContext context)
        {
            int code = context.Response.Status.Code;

            if ((code >= 301 && code <= 303) || code == 307)
            {
                context.Response.SetHeader("Location", handler.Location);
                context.Response.SetCookie("Test", "Cookie");
                return(false);
                // this cancels the responder task, so doesn't require a view. Cookie task MUST come before this!
            }
            return(true);
        }
Exemplo n.º 4
0
 public static bool Impl(IMayRedirect e, Status status, IContext c)
 {
     Called = true;
     return((status.Code >= 301 && status.Code <= 303) || status.Code == 307);
 }
Exemplo n.º 5
0
 public static bool Impl(IMayRedirect e, Status status, IContext c)
 {
     Called = true;
     return ((status.Code >= 301 && status.Code <= 303) || status.Code == 307);
 }