This represents a chunked HTTP Response with headers and the first chunk along with a pointer to the next chunk
Mostly used the Wikipedia page as references: http://en.wikipedia.org/wiki/Basic_access_authentication
Implements DIGEST HTTP Authentication
Implements DIGEST HTTP Authentication
Mostly used the Wikipedia pages as references: http://en.wikipedia.org/wiki/Digest_access_authentication
NOTE: Use at your own risk. We make no claim that any of this Crypto code is correct.
If the request host doesn't match the host param then redirect
This represents a File that we want to send back to the user
This represents a full HTTP Response (both headers and complete body)
Takes a ChunkedInput[ByteBuf] and turns it into a ChunkedInput[HttpContent] so the NettyContentCompressor works
Set this to include the Request.id in the response headers
The maximum number of requests that we will process per connection
How to lookup the client IP from headers (in priority order)
This represents an InputStream that we want to send back to the user
A Mime-Type aware HttpContentCompressor that won't compress content that shouldn't be compressed
Each connection has once instance of this Handler created which means it can be used to track state if needed.
This represents a RandomAccessFile that we want to send back to the user
WARNING: This CANNOT be a case class because we need the equals method to check for reference equality in case instances of this class are stored in HashMaps (e.g.
WARNING: This CANNOT be a case class because we need the equals method to check for reference equality in case instances of this class are stored in HashMaps (e.g. in scala.reflect.runtime.JavaMirrors). Otherwise 2 ReloadingClassLoader with the same argument will look equal to each other even though they have loaded different versions of classes. This will cause stuff like:
java.lang.ClassCastException: fm.catalog.website.CatalogSite cannot be cast to fm.catalog.website.CatalogSite
Holds a reference to a ReloadingClassLoader
Holds a reference to a ReloadingClassLoader
I forget why this originally extended URLClassLoader. I think it might be because some code out there expects the ClassLoader to be a URLClassLoader.
WARNING: See the warning in ReloadingClassLoader about why this is NOT a case class
A RequestRouter that wraps another RequestRouter which will reload classes that change on the fly.
A RequestRouter that wraps another RequestRouter which will reload classes that change on the fly.
For best results limit the scope of the reloadablePackages.
Like a ThreadLocal except for Requests
Like a ThreadLocal except for Requests
You can either instantiate this directly or extend it:
val username = new RequestLocal[String]
object username extends RequestLocal[String]
Adds wrappers around the lifecycle calls to ensure they only get called once
Proxies to another RequestRouter
A RequestRouter that always returns the same handler which should be useful for 404 pages
A RequestRouter that will dispatch to another RequestRouter based on the virtual host name.
A RequestRouter that will dispatch to another RequestRouter based on the virtual host name.
Note: The most specific match wins
Map( "frugalmechanic.com" -> ??? // Matches just "frugalmechanic.com" "*.frugalmechanic.com" -> ??? // Matches any.level.of.sub.domain.frugalmechanic.com (unless there are other more explicit entries) "*" -> ??? // Default catch all )
If the X-SSL header is not set then this redirects to the HTTPS version of the requested URL.
If the X-SSL header is not set then this redirects to the HTTPS version of the requested URL.
TODO: probably need to do something smarter with POST/PUT/etc requests.