Download Latest Version v1.5.2 source code.tar.gz (399.6 kB)
Email in envelope

Get an email when there's a new version of Sisk Framework

Home / 1.5.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2025-08-17 5.2 kB
v1.5 source code.tar.gz 2025-08-17 340.3 kB
v1.5 source code.zip 2025-08-17 491.6 kB
Totals: 3 Items   837.2 kB 0

Contributions

HTTP engine abstraction

The Sisk Framework is now independent of HttpListener.

In this update, all HttpListener-dependent mechanisms have been abstracted into what are called HTTP Engines, which control the abstraction level between the framework and the incoming HTTP components.

With this change, Sisk will be able to use other HTTP processors, such as Cadente Project, Kestrel, or other servers.

Each server can bring features not previously supported natively in Sisk, such as SSL, Quic, pipelining, etc.

Currently, Sisk continues to use .NET's HttpListener as it remains the most stable. Follow and contribute to the development of the Cadente engine for Sisk here.

CORS Improvements

In this update, two global constants have been introduced:

  • CrossOriginResourceSharingHeaders.AutoFromRequestMethod
  • CrossOriginResourceSharingHeaders.AutoFromRequestHeaders

The behavior is similar to CrossOriginResourceSharingHeaders.AutoAllowOrigin: the server responds with CORS headers according to the request:

:::csharp
using var host = HttpServer.CreateBuilder()
    .UseCors(new CrossOriginResourceSharingHeaders(
        allowOrigin: CrossOriginResourceSharingHeaders.AutoAllowOrigin,
        allowMethods: [CrossOriginResourceSharingHeaders.AutoFromRequestMethod],
        allowHeaders: [CrossOriginResourceSharingHeaders.AutoFromRequestHeaders],
        exposeHeaders: [HttpKnownHeaderNames.ContentType, "X-Authenticated-Account-Id"],
        allowCredentials: true))
    ...

Web socket API breaking changes

The entire API for the HttpWebSocket class was changed. The motivation for this change was to reduce async/await errors, since the internal WebSocket object doesn't provide a synchronous API. This API rewrite fixes memory leak issues, error handling in asynchronous events, and message pooling.

  • No more synchronous methods or events.
  • All Send() methods were removed. Use SendAsync() overloads instead.
  • No more WaitForExit() methods. Use ReceiveMessageAsync() with a cancellation token or timeout instead.
  • No more Close(). Use CloseAsync() instead.

Read the updated docs for more info.

Bug fixes and other changes

  • Entirely refactored the LogStream code:
    • General improvements and fixes in concurrent writing.
    • Improvements in asynchronous and synchronous processing.
    • Improvements in the shared LogStream singleton.
    • Fixes for Flush and FlushAsync discharge.
    • Fixed a bug that caused the circular buffer to come in reverse.
    • Implemented IAsyncDisposable.
  • General fixes and improvements in CircularBuffer<T>.
  • Added HttpRequest.DisconnectToken. Note: this feature may not be compatible with all HTTP engines.
  • Added the LogMode property for the HttpContext class. With this property, you can decide which log modes are enabled for the current context, which will override the current route log mode.
  • Added the HttpContext.GetCurrentContext() method, which returns the current HttpContext if the current thread is running on a HTTP request context.
  • Added the HttpResponse.GetHeaderValue() helper method, which attempts to get an header value from both defined HttpResponse.Content.Headers property or HttpResponse.Headers.
  • Added the HttpServerConfiguration.DefaultAccessLogFormat constant.
  • Added the TypedValueDictionary.GetValue and TypedValueDictionary.SetValue helper methods.
  • Added the MimeHelper.IsPlainTextMimeType helper method.
  • Added the {:header} constant literal for the log-formatting options.
  • Improved exception-handling for forwarding resolvers.
  • Fixed an issue where the ForwardingResolver methods could throw an exception before the initialization of the HttpRequest object, which caused the HttpServerExecutionResult.HttpRequest to have an null HttpRequest object.
  • Fixed an possible stack overflow issue when using InitializationParameterCollection.ContainsKey.
  • Fixed an issue where the HTTP server were compressing already compressed contents through the EnableAutomaticResponseCompression option.
  • Fixed an issue where the HTTP server were trying to send responses generated by the Router.CallbackErrorHandler, Router.NotFoundErrorHandler, Router.MethodNotAllowedErrorHandler to contexts where was streaming content.
  • Fixed issues where some HTTP headers could be set after sending content on the HttpResponseStreamManager class.
  • Fixed issues in the access log formatter.
  • Fixed an issue where the HTTP server was not enabling error-logging for user-handled errors.

Full Changelog: https://github.com/sisk-http/core/compare/1.4.3...1.5.0

Source: README.md, updated 2025-08-17