Skip to content

Releases: emrecancorapci/krustie

v0.2.1

29 Dec 14:06
Compare
Choose a tag to compare
v0.2.1 Pre-release
Pre-release
  • Update documentation and imports

v0.2.0-alpha

13 Oct 21:55
fec9e4c
Compare
Choose a tag to compare
v0.2.0-alpha Pre-release
Pre-release

Changes

  • Added tests for request URI parsing and response serialization.
  • Added RequestBuilder to facilitate HTTP request creation for tests.
  • Added Server::mock_request() and Server::mock_request_and_expect() methods for server testing.
  • Added Response::assert_eq() method for comparing two responses.
  • Added methods for testing in Request:
    • set_method
    • set_uri
    • set_version
    • get_version
  • Updated the response parser to sort headers alphabetically.
  • Moved query parameter parsing into a dedicated function to improve the behavior of Request::set_uri().
  • Renamed:
    • Response::insert_header() to Response::set_header()
    • Response::update_body() to Response::set_body()
    • Request::get_queries() to Request::get_query_params()
    • Response::add_local() to Request::set_local()
    • Response::is_err() to Response::is_error()
  • Updated the scope of Request::get_method() to pub.
  • Updated return types:
    • Request::get_header() from Option<&String> to Option<&str>
    • Request::get_path() from String to &str
  • Updated RequestBody enum:
    • Added Binary variant.
    • Changed the data type of Text from Vec<u8> to String.

Version Updates

Fixes

v0.1.12

23 Sep 22:56
Compare
Choose a tag to compare
v0.1.12 Pre-release
Pre-release

Changes

  • Add get_status function to make StatusCode accessible
  • Add doctests to Request module methods
  • Add path parameter to get, post, put patch, delete methods in Router module
  • Add get_query_param method to Request for handling query parameters easily
  • Update insert_header to set_header
  • Update update_body to set_body
  • Update add_local to set_local
  • Update is_err to is_error
  • Update get_header return type from Option<&String> to Option<&str>
  • Update get_path return type from &String to &str
  • Update name of get_queries method to get_query_params
  • Update get_method to make method public
  • Update request body parser to handle body better
  • Update request parser
  • Update Request module to improve documentation

Fixes

  • Fix query parameter parsing for routes that doesn't have parameters

  • Bump serde_json from 1.0.127 to 1.0.128 by @dependabot in #16

v0.1.11

04 Sep 07:31
0bcdbd7
Compare
Choose a tag to compare
v0.1.11 Pre-release
Pre-release

Features

  • Add multi-threading support

Changes

  • Removed ip parameter for Server::listen() method

Package Changes

v0.1.10

22 Aug 09:01
Compare
Choose a tag to compare
v0.1.10 Pre-release
Pre-release

Features

  • Redesigned Router from scratch. Now it supports parameter and query parsing for routes.
  • Added new Endpoint struct to handle endpoints better.
  • Added middleware support for endpoints.

What's Changed

New Contributors

v0.1.9

09 Aug 15:45
Compare
Choose a tag to compare
v0.1.9 Pre-release
Pre-release

Full Changelog: v0.1.8...v0.1.9

v0.1.8

20 Jul 17:54
Compare
Choose a tag to compare
v0.1.8 Pre-release
Pre-release

Features

  • Introduced ContentType to prevent errors caused by invalid or misspelled body types.
  • Introduced new property for Request to be able to access the listened IP.

Updates

  • Updated documentation with more detailed descriptions and new doctests for functions.
  • Updated ServeStatic to use ContentType for file extensions.
  • Improved request parser to catch more invalid requests.
  • Changed the name of the structs and functions below:
    • HttpRequest to Request,
    • HttpResponse to Response,
    • BodyType to RequestBody,
    • ServeStaticFiles to ServeStatic,
    • Request::json_body to Request::body_json

Bugfixes

  • Fix duplicate Content-Length headers caused by response::update_body function.

v0.1.7

15 Jul 13:33
Compare
Choose a tag to compare
v0.1.7 Pre-release
Pre-release

Features

  • Introduced BodyType for handling response body better.
  • New HttpRequest::get_body() function to access body which returns BodyType.

Updates

  • Improved documentations by adding doctests and increasing document coverage to 100%.
  • Updated request parsing for better validation.
  • Deleted request::json::get_body_as_json function since there is no need for it because BodyType intoduced.

Bugfixes

  • Updated router handler to prevent from returning "not found" for valid endpoints.

v0.1.6

07 Jul 13:55
Compare
Choose a tag to compare
v0.1.6 Pre-release
Pre-release

Changes

Features

  • Middlewares can now pass data to controllers using the new locals value.
  • Introduced HttpResponse::update_body() to enhance development experience of middlewares.
  • Added HandlerResult return type for middlewares, enabling chain breaks for scenarios such as static file serving and authentication.

Updates

  • Updated Middleware::middleware() function parameters to enable accessing struct fields.
  • Changed the example in the README file to a simpler and improved version.
  • Moved IP and port parameters from Server::create() to Server::listen() for better configuration.
  • Refined function and struct scopes to reduce verbosity in import lines and enhance encapsulation.
  • Separated static file serving from Server into its own middleware.
  • Removed unnecessary code and refined designs for overall better performance and maintainability.

Bugfixes

  • Resolved an issue where the gzip encoder did not update the body length of the HTTP request when modifying the response.

Packages

v0.1.5

30 Jun 20:18
Compare
Choose a tag to compare
v0.1.5 Pre-release
Pre-release
  • Add basic json parsing functions with serde_json.
  • Update middleware to change the way it used.
  • Update Doctests and README.md.