mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Slightly tweak the redirect code...
--HG-- branch : dev
This commit is contained in:
@@ -99,6 +99,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Default.aspx" />
|
<Content Include="Default.aspx" />
|
||||||
<Content Include="Global.asax" />
|
<Content Include="Global.asax" />
|
||||||
|
<Content Include="Refresh.html" />
|
||||||
<Content Include="Themes\TheAdmin\Styles\ie.css" />
|
<Content Include="Themes\TheAdmin\Styles\ie.css" />
|
||||||
<Content Include="Web.config">
|
<Content Include="Web.config">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
|
15
src/Orchard.Web/Refresh.html
Normal file
15
src/Orchard.Web/Refresh.html
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<title>Configuration Changing...</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>
|
||||||
|
Orchard is temporarily unavailable as a change in configuration requires a restart.
|
||||||
|
A simple page refresh usually solves this issue.</p>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
window.location.reload();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -152,13 +152,21 @@ namespace Orchard.Environment {
|
|||||||
protected virtual void BeginRequest() {
|
protected virtual void BeginRequest() {
|
||||||
MonitorExtensions();
|
MonitorExtensions();
|
||||||
BuildCurrent();
|
BuildCurrent();
|
||||||
|
|
||||||
|
// If setting up extensions/modules requires an AppDomain restart, it's very unlikely the
|
||||||
|
// current request can be processed correctly. So, we redirect to the same URL, so that the
|
||||||
|
// new request will come to the newly started AppDomain.
|
||||||
if (_setupExtensionsContext.RestartAppDomain) {
|
if (_setupExtensionsContext.RestartAppDomain) {
|
||||||
if (HttpContext.Current != null)
|
if (HttpContext.Current != null) {
|
||||||
// Don't redirect posts...
|
// Don't redirect posts...
|
||||||
if (HttpContext.Current.Request.RequestType == "GET")
|
if (HttpContext.Current.Request.RequestType == "GET") {
|
||||||
HttpContext.Current.Response.Redirect(HttpContext.Current.Request.ToUrlString(), true /*endResponse*/);
|
HttpContext.Current.Response.Redirect(HttpContext.Current.Request.ToUrlString(), true /*endResponse*/);
|
||||||
else
|
}
|
||||||
throw new HttpException(T("Orchard is temporarily unavailable as a change in configuration requires a restart. A simple page refresh usually solve this issue.").Text);
|
else {
|
||||||
|
HttpContext.Current.Response.WriteFile("~/Refresh.html");
|
||||||
|
HttpContext.Current.Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user