예제 #1
0
 private void SendURL()
 {
     if (session.IsNewSession)
     {
         StringBuilder url  = new StringBuilder(request.Url.ToString());
         String[]      keys = request.QueryString.AllKeys;
         if (keys.Length > 0)
         {
             url.Append('?');
             foreach (String key in keys)
             {
                 if (!key.ToLower().StartsWith("phprpc_"))
                 {
                     String[] values = request.QueryString.GetValues(key);
                     for (Int32 i = 0, n = values.Length; i < n; i++)
                     {
                         url.Append(key).Append('=').Append(server.UrlEncode(values[i])).Append('&');
                     }
                 }
             }
             url.Length--;
         }
         buffer.Append("phprpc_url=\"");
         buffer.Append(EncodeString(response.ApplyAppPathModifier(url.ToString())));
         buffer.Append("\";\r\n");
     }
 }
예제 #2
0
        /// <summary>
        /// Return the full Web URL
        /// </summary>
        public static string GetWebUrl(HttpRequest request, HttpResponse response)
        {
            var appPath = request.ApplicationPath + (request.ApplicationPath.EndsWith("/") ? "" : "/");

            if (!request.RequestContext.HttpContext.Session.IsCookieless)
            {
                return(appPath);
            }
            return(response.ApplyAppPathModifier(appPath));
        }
예제 #3
0
 public override string ApplyAppPathModifier(string virtualPath)
 {
     return(_httpResponse.ApplyAppPathModifier(virtualPath));
 }
예제 #4
0
 public virtual string ApplyAppPathModifier(string virtualPath)
 {
     return(_response.ApplyAppPathModifier(virtualPath));
 }
        public void Methods_Deny_Unrestricted()
        {
            HttpResponse response = new HttpResponse(writer);

            response.AddCacheItemDependencies(new ArrayList());
            response.AddCacheItemDependency(String.Empty);
            response.AddFileDependencies(new ArrayList());
            response.AddFileDependency(fname);
#if NET_2_0
            response.AddCacheDependency(new CacheDependency[0]);
            response.AddCacheItemDependencies(new string [0]);
            response.AddFileDependencies(new string [0]);
#endif

            try
            {
                response.AppendCookie(new HttpCookie("mono"));
            }
            catch (NullReferenceException)
            {
                // ms
            }

            try
            {
                Assert.IsNull(response.ApplyAppPathModifier(null), "ApplyAppPathModifier");
            }
            catch (NullReferenceException)
            {
                // ms
            }

            try
            {
                response.Clear();
            }
            catch (NullReferenceException)
            {
                // ms
            }

            try
            {
                response.ClearContent();
            }
            catch (NullReferenceException)
            {
                // ms
            }

            try
            {
                response.ClearHeaders();
            }
            catch (NullReferenceException)
            {
                // ms
            }

            try
            {
                response.Redirect("http://www.mono-project.com");
            }
            catch (NullReferenceException)
            {
                // ms
            }
            try
            {
                response.Redirect("http://www.mono-project.com", false);
            }
            catch (NullReferenceException)
            {
                // ms
            }

            try
            {
                response.SetCookie(new HttpCookie("mono"));
            }
            catch (NullReferenceException)
            {
                // ms
            }

            response.Write(String.Empty);
            response.Write(Char.MinValue);
            response.Write(new char[0], 0, 0);
            response.Write(this);
#if NET_2_0
            response.WriteSubstitution(new HttpResponseSubstitutionCallback(Callback));
#endif

            response.Flush();

            response.Close();

            try
            {
                response.End();
            }
            catch (NullReferenceException)
            {
                // ms
            }
        }