public void handleUrlRewrite(Uri uri)
        {
            try
            {
                if (shouldSkipCurrentRequest())
                    return;
                var absolutePath = uri.notNull() ? uri.AbsolutePath : context.Request.Url.AbsolutePath;

                //if (absolutePath.starts("/html_pages/Gui/")) //deal with the cases where there is an relative link inside the html_pages/Gui viewer page
                //    absolutePath = absolutePath.replace("/html_pages/Gui/", "/article/");

                handleUrlRewrite(absolutePath);
            }
            catch (Exception ex)
            {
                if (ex.Message != "Thread was being aborted.")
                    ex.log("[in handleUrlRewrite]");
            }
        }
Beispiel #2
0
        public bool handleUrlRewrite(Uri uri)
        {
            try
            {
                var absolutePath = uri.notNull() ? uri.AbsolutePath
                                                 : request.Url.notNull()
                                                    ? request.Url.AbsolutePath
                                                    : null;

                if (absolutePath.isNull())
                    return false;
                if (absolutePath.siteData_Handle_VirtualPath())
                    return true;
                if (shouldSkipCurrentRequest())
                    return true;

                return handleUrlRewrite(absolutePath);
            }
            catch (Exception ex)
            {
                if (ex.Message != "Thread was being aborted.")
                {
                    ex.logWithStackTrace("[at handleUrlRewrite]");
                    return true;
                }
                return false;
            }
        }
Beispiel #3
0
 public static bool serverOnline(this TM_QA_Config tmQaConfig, Uri targetServer)
 {
     if (targetServer.notNull())
     {
         if (TM_QA_Config.Force_Server_Offline)
             return false;
         return targetServer.append("default.htm")
                            .HEAD();
     }
     return false;
 }
 public static WatiN_IE open(this WatiN_IE watinIe, Uri uri)
 {
     return (watinIe.notNull() && uri.notNull())
         ? watinIe.open(uri.str())
         : watinIe;
 }
 public static WatiN_IE wait_For_Uri(this WatiN_IE watinIe, Uri expectedUri,  int maxWait = 1000)
 {
     return (watinIe.notNull() && expectedUri.notNull())
         ? watinIe.wait_For_Url(expectedUri.str(),maxWait)
         : watinIe;
 }
 public static WatiN_IE assert_Uri_Is(this WatiN_IE watinIe, Uri expectedUri, string message = Extra_NUnit_Messages.ASSERT_URL_IS)
 {
     return (watinIe.notNull() && expectedUri.notNull())
                 ? watinIe.assert_Url_Is(expectedUri.str(),message)
                 : watinIe;
 }