| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
header.
|
| |
|
|
|
|
|
|
| |
We only want to activate flash when the user has enabled it. Api
servers don't use flash, so add an empty implementation to the base
Request object.
|
|
|
|
|
| |
Committing the flash needs to happen in order for the session to be
written correctly, so lets guarantee that it actually does happen.
|
|
|
|
|
| |
I'm doing this so that we can commit the flash to the session object Out
of Band of the flash middleware
|
|
|
|
|
| |
Use the Rack utility methods for functional header manipulation. This
helps to eliminate coupling on the header hash
|
|
|
|
|
| |
The flash middleware shouldn't know how to look up the session object.
Just ask the request for that information.
|
| |
|
|
|
|
|
|
| |
we don't actually need a param parser middleware instance since the
request object will take care of parsing parameters for us. For now,
we'll just configure the parameter parsers on the request in this class.
|
|
|
|
|
|
|
|
| |
The middleware stack is a singleton in the application (one instance is
shared for the entire application) which means that there was only one
opportunity to set the parameter parsers. Since there is only one set
of parameter parsers in an app, lets just configure them on the request
class (since that is where they are used).
|
|
|
|
|
| |
Parameters will not be parsed until they are specifically requested via
the `request_parameters` method.
|
|
|
|
|
| |
`normalize_encode_params` is common to all parser code paths, so we can
pull that up and always apply it before assigning the request parameters
|
|
|
|
|
| |
All parameter parsing should be on the request object because the
request object is the object that we ask for parameters.
|
| |
|
|
|
|
|
| |
`Rack::Session::Abstract::ID` is now deprecated and
`Rack::Session::Abstract::Persisted` should be used instead.
|
|
|
|
| |
It's only used there.
|
|
|
|
|
| |
`CookieJar` is only at the start of the chain and has its own
request method, so we don't need it in the module.
|
|
|
|
| |
It was the same in both legacy versions of the signed and encrypted cookie jars.
|
|
|
|
| |
The `EncryptedCookieJar` already calls it for us, so just delegate to its `parse` implementation.
|
|
|
|
|
| |
`SignedCookieJar`'s parse method already attempts to verify the message,
so we can just call super and try the old verifier if it fails.
|
|
|
|
| |
Cuts down on the duplicated reading parts.
|
|
|
|
| |
Gets rid of the option parsing and makes what the encryptor does stand out.
|
|
|
|
| |
Lets us avoid worrying about parsing the options and doing just what we need.
|
|
|
|
| |
Remove the clutter to make PermanentCookieJar's one change stand out.
|
|
|
|
| |
Eventually this will be the superclass of all the chained jars.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SSL redirect:
* Move `:host` and `:port` options within `redirect: { … }`. Deprecate.
* Introduce `:status` and `:body` to customize the redirect response.
The 301 permanent default makes it difficult to test the redirect and
back out of it since browsers remember the 301. Test with a 302 or 307
instead, then switch to 301 once you're confident that all is well.
HTTP Strict Transport Security (HSTS):
* Shorter max-age. Shorten the default max-age from 1 year to 180 days,
the low end for https://www.ssllabs.com/ssltest/ grading and greater
than the 18-week minimum to qualify for browser preload lists.
* Disabling HSTS. Setting `hsts: false` now sets `hsts: { expires: 0 }`
instead of omitting the header. Omitting does nothing to disable HSTS
since browsers hang on to your previous settings until they expire.
Sending `{ hsts: { expires: 0 }}` flushes out old browser settings and
actually disables HSTS:
http://tools.ietf.org/html/rfc6797#section-6.1.1
* HSTS Preload. Introduce `preload: true` to set the `preload` flag,
indicating that your site may be included in browser preload lists,
including Chrome, Firefox, Safari, IE11, and Edge. Submit your site:
https://hstspreload.appspot.com
|
|
|
|
| |
converts old ID methods to the new abstract store methods in Rack
|
| |
|
|
|
|
|
|
| |
Just include the modules necessary in the Request object to implement
the things we need. This should make it easier to build delegate
request objects because the API is smaller
|
|
|
|
|
|
| |
Escaping and unescaping paths is different than query parameters, and we
need to respect that. This commit uses the new method in Rack to escape
and unescape paths. Fixes #11816
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With changes made in 8363b8 and ae29142 cookies that are mutated on the
request like `cookies.signed = x` were not retained in subsequent tests,
breaking cookie authentiation in controller tests.
The test added demonstrates the issue.
The reason we need to select from non-deleted cookies is because without
checking the `@delete_cookies` the `cookie_jar` `@cookies` will send the
wrong cookies to be updated. The code must check for `@deleted_cookies`
before sending an `#update` with the requests cookie_jar cookies.
This follows how the cookie_jar cookies from the request were updated
before these changes.
|
|
|
|
| |
They are already required in `actionpack/lib/action_dispatch.rb` (L25-L26)
|
|
|
|
|
| |
This `protected` keyword looks like some leftover, since
we are not using explicit receiver, this should go under `private`
|
| |
|
|
|
|
|
| |
I want to implement this with something besides `@env` in the future, so
lets stop directly referencing it.
|
| |
|
|
|
|
|
| |
we already have a request, so we should use the methods on the request
to access the path info information
|
|
|
|
| |
Creates fewer request objects and helps to abstract away from internals
|
| |
|
|
|
|
|
| |
try to remove dependencies on `@env` so we can have more flexible
internals
|
|
|
|
|
| |
This commit allows us to use one request object rather than allocating
multiple request objects to deal with the session.
|
| |
|
|
|
|
|
| |
since we only work with instances of classes, it greatly simplifies the
`Middleware` implementation.
|
|
|
|
|
|
|
|
|
|
| |
Convert things like this:
middleware.use "Foo::Bar"
to this:
middleware.use Foo::Bar
|
|
|
|
|
|
| |
We should do the hard work outside the constructor. Also fix the tests
to not directly construct middleware objects, but to go through the
stack object.
|
|
|
|
|
|
| |
Proc.new will pick up the passed in block, but since it's a default
param, it won't get evaluated unless someone doesn't pass in an app. It
will raise an exception if no block is provided.
|
|
|
|
|
| |
this is another place that we should stop directly accessing the env
hash and let the request object take care of that for us
|
| |
|
|
|
|
|
|
|
| |
again, we want to hide the contents of `env` from the implementation.
Allocate a request object to access the contents of env, but save
allocations due to string literal allocations when accessing the env
hash.
|
|
|
|
|
| |
hide the env key in the request object so that other code doesn't need
to know.
|