mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00

committed by
Sebastien Ros

parent
dd73289c53
commit
34d6e5198a
@@ -107,7 +107,15 @@ namespace Orchard.Environment {
|
|||||||
|
|
||||||
public ShellSettings Match(HttpContextBase httpContext) {
|
public ShellSettings Match(HttpContextBase httpContext) {
|
||||||
// use Host header to prevent proxy alteration of the orignal request
|
// use Host header to prevent proxy alteration of the orignal request
|
||||||
return Match(httpContext.Request.Headers["Host"] ?? string.Empty, httpContext.Request.AppRelativeCurrentExecutionFilePath);
|
var httpRequest = httpContext.Request;
|
||||||
|
if(httpRequest == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var host = httpRequest.Headers["Host"];
|
||||||
|
var appRelativeCurrentExecutionFilePath = httpRequest.AppRelativeCurrentExecutionFilePath;
|
||||||
|
|
||||||
|
return Match(host ?? string.Empty, appRelativeCurrentExecutionFilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShellSettings Match(string host, string appRelativePath) {
|
public ShellSettings Match(string host, string appRelativePath) {
|
||||||
|
@@ -68,7 +68,7 @@ namespace Orchard.Logging {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var ctx = HttpContext.Current;
|
var ctx = HttpContext.Current;
|
||||||
if (ctx != null) {
|
if (ctx != null && ctx.Request != null) {
|
||||||
ThreadContext.Properties["Url"] = ctx.Request.Url.ToString();
|
ThreadContext.Properties["Url"] = ctx.Request.Url.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user