Releases: emrecancorapci/krustie
Releases · emrecancorapci/krustie
v0.2.1
- Update documentation and imports
v0.2.0-alpha
Changes
- Added tests for request URI parsing and response serialization.
- Added
RequestBuilder
to facilitate HTTP request creation for tests. - Added
Server::mock_request()
andServer::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()
toResponse::set_header()
Response::update_body()
toResponse::set_body()
Request::get_queries()
toRequest::get_query_params()
Response::add_local()
toRequest::set_local()
Response::is_err()
toResponse::is_error()
- Updated the scope of
Request::get_method()
topub
. - Updated return types:
Request::get_header()
fromOption<&String>
toOption<&str>
Request::get_path()
fromString
to&str
- Updated
RequestBody
enum:- Added
Binary
variant. - Changed the data type of
Text
fromVec<u8>
toString
.
- Added
Version Updates
- Bump
regex
from 1.10.6 to 1.11.0 by @dependabot in PR #22 - Bump
flate2
from 1.0.33 to 1.0.34 by @dependabot in PR #21
Fixes
Response::get_body()
now returns the body as immutable by @emrecancorapci in PR #26- Removed extra
\r\n
at the end of HTTP response headers by @emrecancorapci in PR #28 - Resolved the
Invalid HTTP version
error in the request parser by @emrecancorapci in PR #29
v0.1.12
Changes
- Add
get_status
function to makeStatusCode
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
toset_header
- Update
update_body
toset_body
- Update
add_local
toset_local
- Update
is_err
tois_error
- Update get_header return type from
Option<&String>
toOption<&str>
- Update get_path return type from
&String
to&str
- Update name of
get_queries
method toget_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
Features
- Add multi-threading support
Changes
- Removed ip parameter for
Server::listen()
method
Package Changes
- Bump serde_json from 1.0.125 to 1.0.127 by @dependabot in #12
- Bump flate2 from 1.0.32 to 1.0.33 by @dependabot in #13
v0.1.10
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
- docs: 📝 MIT License added by @onuralpszr in #1
- fix: 🐞 gitignore improved based on current rust-lang by @onuralpszr in #4
- ci: 👷 dependabot config added by @onuralpszr in #6
- feat: ✨ compile profiles are added into cargo.toml by @onuralpszr in #2
- Bump flate2 from 1.0.30 to 1.0.31 by @dependabot in #7
- Bump serde_json from 1.0.120 to 1.0.122 by @dependabot in #8
- docs: 📝 CODE_OF_CONDUCT.md added by @onuralpszr in #5
- feat: ✨ initial rustfmt config and files are formatted by @onuralpszr in #3
- Bump serde_json from 1.0.122 to 1.0.124 by @dependabot in #9
- Bump serde_json from 1.0.124 to 1.0.125 by @dependabot in #10
- Bump flate2 from 1.0.31 to 1.0.32 by @dependabot in #11
New Contributors
- @onuralpszr made their first contribution in #1
- @dependabot made their first contribution in #7
v0.1.9
Full Changelog: v0.1.8...v0.1.9
v0.1.8
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 useContentType
for file extensions. - Improved request parser to catch more invalid requests.
- Changed the name of the structs and functions below:
HttpRequest
toRequest
,HttpResponse
toResponse
,BodyType
toRequestBody
,ServeStaticFiles
toServeStatic
,Request::json_body
toRequest::body_json
Bugfixes
- Fix duplicate Content-Length headers caused by
response::update_body
function.
v0.1.7
Features
- Introduced
BodyType
for handling response body better. - New
HttpRequest::get_body()
function to access body which returnsBodyType
.
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 becauseBodyType
intoduced.
Bugfixes
- Updated router handler to prevent from returning "not found" for valid endpoints.
v0.1.6
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()
toServer::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
- Add basic json parsing functions with serde_json.
- Update middleware to change the way it used.
- Update Doctests and README.md.