-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling Sessions with an 'Environment' #246
Commits on Aug 1, 2015
-
feat(server): add some shared data across all requests
This can be used to add some compile time dependencies for Middleware and Plugins. To fix code broken by this, you will need to introduce a type parameter for Request, Response, MiddlewareResult and NickelError. ``` // e.g. This fn foo<'a>(&mut Request, Response<'a>) -> MiddlewareResult<'a> // Should become: fn foo<'a, D>(&mut Request<D>, Response<'a, D>) -> MiddlewareResult<'a, D> ``` You can add bounds to `D` in the above to place compile-time restrictions on the server data (can be used for configuration). BREAKING CHANGE
Configuration menu - View commit details
-
Copy full SHA for d8983be - Browse repository at this point
Copy the full SHA d8983beView commit details -
Configuration menu - View commit details
-
Copy full SHA for 47b0136 - Browse repository at this point
Copy the full SHA 47b0136View commit details -
feat(response): allow Plugins for Response
Also adds `on_send` which can be used to execute code when the Response headers are being sent.
Configuration menu - View commit details
-
Copy full SHA for 2304e8c - Browse repository at this point
Copy the full SHA 2304e8cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1239748 - Browse repository at this point
Copy the full SHA 1239748View commit details -
Configuration menu - View commit details
-
Copy full SHA for 13f1ad4 - Browse repository at this point
Copy the full SHA 13f1ad4View commit details -
fix(cookies): add explicit implementations for Cookies trait
The 1.2 beta has a regression for this kind of code, so being explicit should allow us to compile on all targets.
Configuration menu - View commit details
-
Copy full SHA for 7a60286 - Browse repository at this point
Copy the full SHA 7a60286View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5b4e23b - Browse repository at this point
Copy the full SHA 5b4e23bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 23bb400 - Browse repository at this point
Copy the full SHA 23bb400View commit details -
refactor(*): Request is now accessible through a Response instance
This is motivated to allow writing Plugins which are able to access both the current Response and Request without having to rely on odd syntax such as `(foo, bar).baz()`. BREAKING CHANGE: This breaks a *lot* of nickel usage, checking the diff from the examples should help to migrate code relying on the old structure.
Configuration menu - View commit details
-
Copy full SHA for ebc6aa9 - Browse repository at this point
Copy the full SHA ebc6aa9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 47a728d - Browse repository at this point
Copy the full SHA 47a728dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4fb224d - Browse repository at this point
Copy the full SHA 4fb224dView commit details -
feat(macros): allow hinting the server data type in middleware macro
This can sometimes be required when using some middleware which are predicated on the datatype of the Server. An alternative would be to litter the handler with extra type annotations (which is awkward without type ascription), or to use explicit type-annotated functions as middleware. Example usage: ``` middleware! { |res| <ServerData> // res is of type Response<ServerData> } ```
Configuration menu - View commit details
-
Copy full SHA for edea3ab - Browse repository at this point
Copy the full SHA edea3abView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5aa0833 - Browse repository at this point
Copy the full SHA 5aa0833View commit details