mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 12:09:40 +00:00
Core - FolderSchemeHandlerFactory add protected virtual Create method
override Create to implement custom behaviour
This commit is contained in:
@@ -68,11 +68,30 @@ namespace CefSharp.SchemeHandler
|
||||
/// A IResourceHandler
|
||||
/// </returns>
|
||||
IResourceHandler ISchemeHandlerFactory.Create(IBrowser browser, IFrame frame, string schemeName, IRequest request)
|
||||
{
|
||||
return Create(browser, frame, schemeName, request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If the file requested is within the rootFolder then a IResourceHandler reference to the file requested will be returned
|
||||
/// otherwise a 404 ResourceHandler will be returned.
|
||||
/// </summary>
|
||||
/// <param name="browser">the browser window that originated the
|
||||
/// request or null if the request did not originate from a browser window
|
||||
/// (for example, if the request came from CefURLRequest).</param>
|
||||
/// <param name="frame">frame that originated the request
|
||||
/// or null if the request did not originate from a browser window
|
||||
/// (for example, if the request came from CefURLRequest).</param>
|
||||
/// <param name="schemeName">the scheme name</param>
|
||||
/// <param name="request">The request. (will not contain cookie data)</param>
|
||||
/// <returns>
|
||||
/// A IResourceHandler
|
||||
/// </returns>
|
||||
protected virtual IResourceHandler Create(IBrowser browser, IFrame frame, string schemeName, IRequest request)
|
||||
{
|
||||
if (this.schemeName != null && !schemeName.Equals(this.schemeName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return ResourceHandler.ForErrorMessage(string.Format("SchemeName {0} does not match the expected SchemeName of {1}.", schemeName, this.schemeName), HttpStatusCode.NotFound);
|
||||
|
||||
}
|
||||
|
||||
var uri = new Uri(request.Url);
|
||||
|
||||
Reference in New Issue
Block a user