|
|
@ -124,6 +124,13 @@ namespace Apewer.Web |
|
|
|
// 寻找入口。
|
|
|
|
void Invoke() |
|
|
|
{ |
|
|
|
// OPTIONS
|
|
|
|
if (_context.Request.Method == HttpMethod.OPTIONS) |
|
|
|
{ |
|
|
|
_context.Response.Model = new ApiTextModel(""); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// 路由
|
|
|
|
if (_context.Options.UseRoute) |
|
|
|
{ |
|
|
@ -134,7 +141,6 @@ namespace Apewer.Web |
|
|
|
{ |
|
|
|
_context.ApiAction = action; |
|
|
|
Invoke(action); |
|
|
|
_context.Response.Duration = Duration(_context.Beginning); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -145,7 +151,6 @@ namespace Apewer.Web |
|
|
|
var appName = _context.Request.Application; |
|
|
|
var application = _context.Entries.GetApplication(appName); |
|
|
|
Invoke(application); |
|
|
|
_context.Response.Duration = Duration(_context.Beginning); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
@ -580,7 +585,7 @@ namespace Apewer.Web |
|
|
|
} |
|
|
|
|
|
|
|
// Content-Type 检查。
|
|
|
|
if (options.WithContentTypeOptions || options.Default != null) |
|
|
|
if (options.WithContentTypeOptions) |
|
|
|
{ |
|
|
|
merged.Add("X-Content-Type-Options", "nosniff"); |
|
|
|
} |
|
|
|