-
-
Notifications
You must be signed in to change notification settings - Fork 196
Releases: kemalcr/kemal
Releases Β· kemalcr/kemal
v1.11.0
- (SECURITY) Fix chunked multipart body limits #748. Thanks @canermastan π
This PR adds a new config option:
Kemal.config.max_multipart_form_field_size = 8 * 1024 * 1024
- (SECURITY) Add Websocket origin validation and configuration support #749. Thanks @past3l π
This PR adds a new config option:
Kemal.config.websocket_allowed_origins = ["https://myapp.com", "http://localhost:3000"]
Assets 2
3 people reacted
v1.10.1
- Add
shutdown_timeoutconfiguration for graceful shutdown: afterKemal.stop, Kemal can wait before exit so in-flight work can finish #745. Thanks @sdogruyol π
Kemal.config.shutdown_timeout = 10.seconds
Assets 2
3 people reacted
v1.10.0
This is the biggest Kemal release ever with new features and a lot of improvements π
- Add modular
Kemal::Routerwith namespaced routing, scoped filters, WebSocket support and flexible mounting while keeping the existing DSL fully compatible #731. Thanks @sdogruyol π
require "kemal" api = Kemal::Router.new api.namespace "/users" do get "/" do |env| env.json({users: ["alice", "bob"]}) end get "/:id" do |env| env.text "user #{env.params.url["id"]}" end end mount "/api/v1", api Kemal.run
- Add
usekeyword for registering global and path-specific middleware, including support for arrays and insertion at a specific position in the handler chain #734. Thanks @sdogruyol π
require "kemal" # Path-specific middlewares for /api routes use "/api", [CORSHandler.new, AuthHandler.new] get "/" do "Public home" end get "/api/users" do |env| env.json({users: ["alice", "bob"]}) end Kemal.run
- Enhance response helpers to provide chainable JSON/HTML/text/XML helpers,
HTTP::Statussupport and the ability to halt execution from a chained response for concise API error handling #733, #735, #736. Thanks @sdogruyol and @mamantoha π
require "kemal" get "/users" do |env| # Default JSON response env.json({users: ["alice", "bob"]}) end post "/users" do |env| # Symbol-based HTTP::Status and chained JSON env.status(:created).json({id: 1, created: true}) end get "/admin" do |env| # Halt immediately with HTML response halt env.status(403).html("<h1>Forbidden</h1>") end get "/api/users" do |env| # Custom content type (JSON:API) env.json({data: ["alice", "bob"]}, content_type: "application/vnd.api+json") end Kemal.run
- Ensure global wildcard filters always execute while keeping namespace filters isolated to their routes #737. Thanks @mamantoha π
- Fix CLI SSL validation and expand CLI option parsing specs #738. Thanks @sdogruyol π
- Make route LRU cache concurrency-safe with Mutex #739. Thanks @sdogruyol π
- Add
raw_bodyto ParamParser for multi-handler body access (e.g. kemal-session) #740. Thanks @sdogruyol π
post "/" do |env| raw = env.params.raw_body # raw body, multiple handlers can call it env.params.body["name"] # parsed body end
- Fix OverrideMethodHandler route cache bug when using
_methodoverride #741, #742. Thanks @skojin and @sdogruyol π
Assets 2
15 people reacted
v1.9.0
- Crystal 1.19.0 support π
- (SECURITY) Limit maximum request body size to avoid DoS attacks #730. Thanks @sdogruyol π
- Optimize JSON parameter parsing by directly using the request body IO. Thanks @sdogruyol π
Assets 2
6 people reacted
v1.8.0
This release brings a lot of performance improvements π
- Enhance HEAD request handling by caching GET route lookups and optimize path construction using string interpolation for improved performance #728. Thanks @sdogruyol π
- Improve error messages #726. Thanks @sdogruyol π
- Optimize route and websocket lookups by caching results to reduce redundant processing in the HTTP server context #725. Thanks @sdogruyol π
- Replace full-flush Route cache with LRU and add a configurable max cache size #724. Thanks @sdogruyol π
Assets 2
6 people reacted
v1.7.3
- Refactor #719. Thanks @sdogruyol π
- Improve Kemal test suite. Thanks @sdogruyol π
Assets 2
4 people reacted
v1.7.2
- Move Kemal::Handler logic into separate module #717. Thanks @syeopite π
- Refactor server binding logic to avoid binding in test environment #719. Thanks @sdogruyol π
Assets 2
4 people reacted
v1.7.1
- Improve
StaticFileHandlerto align with latest Crystal implementation #711. Thanks @sdogruyol @straight-shoota π
Assets 2
2 people reacted
v1.7.0
All users are strongly advised to update immediately.
- (SECURITY) Fix a Path Traversal Security issue in
StaticFileHandler. See for more details. Huge THANKS to @ahmetumitbayram π - Crystal 1.16.0 support π
- Add ability to add handlers for raised exceptions #688. Thanks @syeopite π
require "kemal" class NewException < Exception end get "/" do | env | raise NewException.new() end error NewException do | env | "An error occured!" end Kemal.run
- Add
all_filesmethod toparamsto support multiple file uploads in names ending with[]#701. Thanks @sdogruyol π
images = env.params.all_files["images[]"]?
- Embrace Crystal standard Log for logging #705. Thanks @hugopl π
- Cleanup temporary files for file uploads #707. Thanks @sdogruyol π
- Implement multiple partial ranges #708. Thanks @sdogruyol π
Assets 2
5 people reacted
v1.6.0
- Crystal 1.14.0 support π
- Windows support #690. Thanks @sdogruyol π
- Directory Listing: Add UTF-8 Charset to the response Content type #679. Thanks @alexkutsan @Sija π
- Use context instead of response in static_headers helper #681. Thanks @sdogruyol π
Assets 2
5 people reacted