Releases: scottoffen/grapevine-legacy
4.0.0.125
Important Bug Fixes!
#121 Routes Fail To Automatically Registered When Server Starts With Empty Routing Table
If you were manually registering your routes, this didn't impact you. If you were counting on having the route register automatically when you started your server, this was failing. When I put in the new RouteScanner
I hooked it up in the RestServer
incorrectly - so, while it was scanning your assembly and creating routes, they weren't being added to the Router
s routing table. Routes are now being added to the routing table correctly under these conditions.
#120 RestServer Populates Empty Router Before Calling OnBeforeStart
Invoking the OnBeforeStart
generic delegate should happen before anything else in the Start()
method, but I noticed I had the router registering routes first, then the delegate got invoked. RestServer
will now execute those in the correct order.
#119 RouteScanner scans vhost32
This is only an issue in a development environment, but I found it annoying. A quick fix now makes sure that this assembly isn't scanned during the scanning process.
#118 RouteScanner Doesn't Check Included Namespaces
In general this turned out to be something of a non-issue, but some code was changed as a result. In the future, including namespaces very well might be something that gets pulled out entirely.
4.0.0.115
Resolved a number of miscellaneous bugs in addition to the following issues:
#110 Improved Error Handling in Router
Updated such that if the Begin
delegate gets invoked successfully, the After
delegate will also be invoked, even if exceptions are thrown in the request routing process.
#113 Replaced ReadOnlyDictionary
The read-only feature wasn't really providing any value. Each route gets a new instance of the dictionary anyway, so if you make changes to it in one route, the next route won't receive those changes.
Automatic routing has been separated out into its own concern - RouteScanner
- and is now accessed via a property on the Router
class - Router.Scanner
. While it can be invoked manually, its Scan()
method will be called automatically if the server is started with an empty routing table.
Scan()
can only scan assemblies in the currentAppDomain
.
#117 Error Parsing ContentType From String
There was an issue in the client where it was unable to parse a value from the ContentType
enum for the value in the string in the request. A new extension method was added to both resolve this and make the functionality consistent between the client and the server.
4.0.0.82
Improved exception handling on starting and stopping the server
Implemented fix for handling timeouts on rest client (re-throwing timeout exception)
Closed reader before closing stream
4.0.0.79
4.0.0.74
4.0.0.53
#82 Removed dependency on System.Web
After all the changes from 3.x to 4.0, the only reference to System.Web
was to do some simple URI encoding, and there are WAY small implementations to use. So, this dependency has been refactored out.
#83 Changed RestClient
and RestResource
to use UriBuilder
The original implementation in the client was doing a lot of work that UriBuilder
inherently does, so it made sense to update my implementation to utilize it. This came with some additional refactoring in the client, but nothing too drastic.
#84 Added mechanism to define specific code to execute prior to and after all routes
Completely optional, this provides a route-registration independent way to ensure something gets ran prior to every route (such as authentication and/or database allocation) and after the routing table execution completes (such as closing files and connections) - regardless of what type of response was sent to the requesting client.
Router.Before
and Router.After
both take generic delegates with a signature Func<IHttpContext, IHttpContext>
#85 Added content types for form data
When switching everything over to use the Grapevine specific ContentType
class, I discovered that I lacked MIME types for form data. The oversight has been remedied with the addition of ContentType.FormUrlEncoded
and ContentType.MultipartFormData
.
4.0.0-alpha.4
#70 Refactored dynamic properties
- Rename
DynamicAspect
toDynamicProperties
- Rename the field from
Dynamic
toProperties
- Remove dynamic property from
HttpRequest
andHttpResponse
- Add (or keep) dynamic property on
RestServer
andHttpContext
- Lazy load
ExpandoObject
#71 Added a flag to continue routes after response sent
There may be a case where you want all routes to execute, even after a response has been sent to the client. Added a property to the Router
class to toggle this behavior on and off, and updated .Route()
to honor the flag.
Note that when this is turned on, it will become the responsibility of the individual routes to ensure that a response has not already been sent before attempting to send one.
#73 Removed .IsValidRegex()
private method from ParamParser
It really wasn't doing anything of value.
#74 Changed ContentRoot
to PublicFolder
The latter more accurately describes it's purpose.
#75 Added an In Memory Implementation of IGrapevineLogger
For easier unit and integration testing
#76 Returning a file should filter on GET and HEAD
Was previously only filtering on GET
#77 Added Description
Property to Route
So you can provide an easy to read description of the route for debugging purposes
#78 Altered IHttpContext.WasRespondedTo()
to be a property instead of a method
#80 Refactoring for Extension
Refactoring to make Server objects easier to extend. This primarily involved changing the access of some properties to protected
and adding additional properties to the Advanced
sections.
4.0.0-alpha.3
Fix for issue #69, Failing to serve static content.
4.0.0-alpha.2
Complete client refactoring: exposing more of underlying HttpWebRequest and HttpWebResponse methods, moving functionality to more appropriate classes, changed QueryString and PathParams to use composition.
4.0.0-alpha.1
Contains bug fixes and enhancements for multiple issues.
#27 InternalServerError override not invoked in implementation of RESTResource
This is now obsolete, given that there is no longer a method to override.
#40 Implement thread-safe RestServer.Stop() for use in routes
Added the method ThreadSafeStop()
to the RestServer
class, added IRestServer
to IHttpContext
to ensure the method would be available to all routes.
#42 RestServer Authentication
In addition to the new routing table implementation, see #58
#43 Creating a cluster with multiple RESTServers does not process HTTP requests
Unable to duplicate. See the Grapevine.Integration
project for example code.
#44 Passing application-specific info to response handlers
Added an ExpandoObject
to the HttpContext
, HttpRequest
and HttpResponse
classes. Pass data around to your hearts content! Additionally, the route creation methods can aid in providing additional context to the response handlers.
#49 Add logging interface to replace now defunct EventLogger
See IGrapevineLogger
; create your own implementation and pass it to the RestServer
instance.
#53 Make calling server accessible to routes
Added IRestServer
property to IHttpContext
#56 Add mechanism to find an open port on a given host
See PortFinder
class; has both synch and asynch static and instance methods.
#57 Add Dynamic property to RestServer
class
Added an ExpandoObject
to the RestServer
#58 Provide limited access to the underlying HttpListener instance
Added an Advanced
property to the RestServer
class that provides access to (almost) all the methods and properties of the underlying HttpListener
. Use with caution.
#59 Enable and disable individual routes
Added Enable()
and Disable()
methods to IRoute