Example #1
0
 public IISContextFactory(MemoryPool <byte> memoryPool, IHttpApplication <T> application, IISServerOptions options, IISHttpServer server)
 {
     _application = application;
     _memoryPool  = memoryPool;
     _options     = options;
     _server      = server;
 }
        public IISHttpServer(
            IISNativeApplication nativeApplication,
            IHostApplicationLifetime applicationLifetime,
            IAuthenticationSchemeProvider authentication,
            IOptions <IISServerOptions> options,
            ILogger <IISHttpServer> logger
            )
        {
            _nativeApplication   = nativeApplication;
            _applicationLifetime = applicationLifetime;
            _logger  = logger;
            _options = options.Value;
            _serverAddressesFeature = new ServerAddressesFeature();

            if (_options.ForwardWindowsAuthentication)
            {
                authentication.AddScheme(new AuthenticationScheme(IISServerDefaults.AuthenticationScheme, _options.AuthenticationDisplayName, typeof(IISServerAuthenticationHandlerInternal)));
            }

            Features.Set <IServerAddressesFeature>(_serverAddressesFeature);

            if (_options.MaxRequestBodySize > _options.IisMaxRequestSizeLimit)
            {
                _logger.LogWarning(CoreStrings.MaxRequestLimitWarning);
            }
        }
 internal unsafe IISHttpContext(MemoryPool <byte> memoryPool, IntPtr pInProcessHandler, IISServerOptions options, IISHttpServer server)
     : base((HttpApiTypes.HTTP_REQUEST *)NativeMethods.HttpGetRawRequest(pInProcessHandler))
 {
     _memoryPool        = memoryPool;
     _pInProcessHandler = pInProcessHandler;
     _options           = options;
     _server            = server;
 }
 public IISContextFactory(MemoryPool <byte> memoryPool, IHttpApplication <T> application, IISServerOptions options, IISHttpServer server, ILogger logger)
 {
     _application = application;
     _memoryPool  = memoryPool;
     _options     = options;
     _server      = server;
     _logger      = logger;
     AppContext.TryGetSwitch(Latin1Suppport, out _useLatin1);
 }
Example #5
0
        public static async Task <TestServer> Create(Action <IApplicationBuilder> appBuilder, ILoggerFactory loggerFactory, IISServerOptions options)
        {
            await WebCoreLock.WaitAsync();

            _options = options;
            var server = new TestServer(appBuilder, loggerFactory);

            server.Start();
            (await server.HttpClient.GetAsync("/start")).EnsureSuccessStatusCode();
            await server._startedTaskCompletionSource.Task;

            return(server);
        }
Example #6
0
        internal unsafe IISHttpContext(
            MemoryPool <byte> memoryPool,
            IntPtr pInProcessHandler,
            IISServerOptions options,
            IISHttpServer server,
            ILogger logger)
            : base((HttpApiTypes.HTTP_REQUEST *)NativeMethods.HttpGetRawRequest(pInProcessHandler))
        {
            _memoryPool        = memoryPool;
            _pInProcessHandler = pInProcessHandler;
            _options           = options;
            _server            = server;
            _logger            = logger;

            ((IHttpBodyControlFeature)this).AllowSynchronousIO = _options.AllowSynchronousIO;
        }
Example #7
0
        public IISHttpServer(
            IISNativeApplication nativeApplication,
            IApplicationLifetime applicationLifetime,
            IAuthenticationSchemeProvider authentication,
            IOptions <IISServerOptions> options,
            ILogger <IISHttpServer> logger
            )
        {
            _nativeApplication   = nativeApplication;
            _applicationLifetime = applicationLifetime;
            _logger  = logger;
            _options = options.Value;

            if (_options.ForwardWindowsAuthentication)
            {
                authentication.AddScheme(new AuthenticationScheme(IISServerDefaults.AuthenticationScheme, _options.AuthenticationDisplayName, typeof(IISServerAuthenticationHandler)));
            }
        }
Example #8
0
 public IISHttpContextOfT(MemoryPool <byte> memoryPool, IHttpApplication <TContext> application, IntPtr pInProcessHandler, IISServerOptions options, IISHttpServer server, ILogger logger)
     : base(memoryPool, pInProcessHandler, options, server, logger)
 {
     _application = application;
 }
Example #9
0
 public static Task <TestServer> Create(RequestDelegate app, ILoggerFactory loggerFactory, IISServerOptions options)
 {
     return(Create(builder => builder.Run(app), loggerFactory, options));
 }
Example #10
0
 public IISHttpContextOfT(MemoryPool <byte> memoryPool, IHttpApplication <TContext> application, NativeSafeHandle pInProcessHandler, IISServerOptions options, IISHttpServer server, ILogger logger, bool useLatin1)
     : base(memoryPool, pInProcessHandler, options, server, logger, useLatin1)
 {
     _application = application;
 }
Example #11
0
 public void Configure(IISServerOptions options)
 {
     options.MaxRequestBodySize = 262144000;
 }