Skip to content

v1.4

Choose a tag to compare

@CypherPotato CypherPotato released this 10 Feb 18:22
· 232 commits to main since this release

Full Changelog: 1.3.2.0...1.4.0.1


v1.4

Goodbye, HttpServerFlags!

Some "advanced" properties of the server, present in the old HttpServerFlags, have been migrated to the HttpServerConfiguration object. This means that the HttpServerFlags class has also been removed, along with all references to it.

See below for the migrated and removed properties:

Property name State Observations
ThrowContentOnNonSemanticMethods ❌ Removed See note 1.
PreventResponseContentsInProhibitedMethods ❌ Removed See note 1.
AsyncRequestProcessing ➡ Migrated
HeaderNameRequestId ❌ Removed
SendCorsHeaders ❌ Removed See note 2.
TreatHeadAsGetMethod ❌ Removed See note 3.
OptionsLogMode ➡ Migrated
SendSiskHeader ➡ Migrated
WebSocketBufferSize ❌ Removed
RequestStreamCopyBufferSize ❌ Removed
NormalizeHeadersEncodings ➡ Migrated
ForceTrailingSlash ➡ Migrated
IdleConnectionTimeout ➡ Migrated
EnableNewMultipartFormReader ❌ Removed See other changes.
ConvertIAsyncEnumerableIntoEnumerable ➡ Migrated

Note 1: This is a overreal design change in Sisk. In summary, the framework will no longer treat the developer like a baby and prevent them from performing illegal operations according to the HTTP RFC. Instead, Sisk will allow it, but the responsibility of following the HTTP fundamentals now lies with the user, not the framework.

Note 2: The server will no longer listen to the SendCorsHeaders property. To not send CORS headers, you can use an empty or null instance of CrossOriginResourceSharingHeaders.Empty in your ListeningHost. Another option is to disable the use of CORS for that route with the Route.UseCors property. Additionally, you can define routes of type RouteMethod.Options to manually handle OPTIONS requests.

Note 3: The HTTP server will no longer treat HEAD requests as GET. You can still define routes with RouteMethod.Head and handle them directly, or use RouteMethod.Get | RouteMethod.Head to handle a route for two different methods, and get the request method with HttpRequest.Method.

Easy compressed contents

Added 3 new HTTP contents:

These contents provides a easy way to compress HTTP contents of a response on-the-fly, like:

router.MapGet("/hello.html", request => {
    string myHtml = "...";
    
    return new HttpResponse () {
        Content = new GZipContent(new HtmlContent(myHtml))
    };
});

You can also extend your own compressing content from the CompressedContent class.

Auto-dispose IDisposable context values

The new DisposeDisposableContextValues property allows values that are IDisposable to be automatically disposed of at the end of an HTTP context, removing the need to create a RequestHandler for this task.

Other changes

  • Added the Router.CheckForRouteCollisions property.
  • Added the StringKeyStore.AsStringValueCollection method.
  • Removed the experimental warning from the HttpContext.Current property.
  • Removed the old Multipart Form parser.
  • Fixed an issue where the served HttpContent wasn't being correctly disposed in certain situations.
  • Deprecated the HttpServerExecutionResult.DnsFailed field.
  • Breaking: removed the HttpServerHostContextBuilder.UseFlags method.
  • Breaking: removed the StringValue.GetParsable<T> method. You should use the StringValue.Get<T> method instead.