aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/middleware
Commit message (Collapse)AuthorAgeFilesLines
...
* | inherit from our AbstractStoreAaron Patterson2015-09-251-5/+1
| |
* | pull the flash methods in to their own moduleAaron Patterson2015-09-251-34/+38
| | | | | | | | | | | | 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.
* | commit the flash after the controller finishes being servicedAaron Patterson2015-09-251-10/+16
| | | | | | | | | | Committing the flash needs to happen in order for the session to be written correctly, so lets guarantee that it actually does happen.
* | move flash committing to the request object.Aaron Patterson2015-09-251-12/+1
| | | | | | | | | | I'm doing this so that we can commit the flash to the session object Out of Band of the flash middleware
* | build the Set-Cookie header functionallyAaron Patterson2015-09-241-5/+18
| | | | | | | | | | Use the Rack utility methods for functional header manipulation. This helps to eliminate coupling on the header hash
* | ask the request object for the sessionAaron Patterson2015-09-221-1/+1
| | | | | | | | | | The flash middleware shouldn't know how to look up the session object. Just ask the request for that information.
* | TypppoAkira Matsuda2015-09-211-3/+3
| |
* | do not instantiate a param parser middlewareAaron Patterson2015-09-181-6/+2
| | | | | | | | | | | | 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.
* | push the parameter parsers on to the classAaron Patterson2015-09-181-12/+2
| | | | | | | | | | | | | | | | 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).
* | stop eagerly parsing parametersAaron Patterson2015-09-181-2/+0
| | | | | | | | | | Parameters will not be parsed until they are specifically requested via the `request_parameters` method.
* | pull `normalize_encode_params` upAaron Patterson2015-09-181-2/+1
| | | | | | | | | | `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
* | move parameter parsing to the request objectAaron Patterson2015-09-181-21/+3
| | | | | | | | | | All parameter parsing should be on the request object because the request object is the object that we ask for parameters.
* | Fix HSTS default expire in ActionDispatch::SSL docs.Pedro Nascimento2015-09-141-1/+2
| |
* | Update documentation to reflect Rack::Session::Abstract changeseileencodes2015-09-091-1/+1
| | | | | | | | | | `Rack::Session::Abstract::ID` is now deprecated and `Rack::Session::Abstract::Persisted` should be used instead.
* | Push key_generator into SerializedCookieJarsKasper Timm Hansen2015-09-081-4/+4
| | | | | | | | It's only used there.
* | Move the request method in to the AbstractCookieJarKasper Timm Hansen2015-09-081-4/+3
| | | | | | | | | | `CookieJar` is only at the start of the chain and has its own request method, so we don't need it in the module.
* | Pull up parse to the legacy upgrading moduleKasper Timm Hansen2015-09-081-10/+5
| | | | | | | | It was the same in both legacy versions of the signed and encrypted cookie jars.
* | Call super to remove the decrypt_and_verify methodKasper Timm Hansen2015-09-081-8/+4
| | | | | | | | The `EncryptedCookieJar` already calls it for us, so just delegate to its `parse` implementation.
* | Call super to remove the verify methodKasper Timm Hansen2015-09-081-8/+2
| | | | | | | | | | `SignedCookieJar`'s parse method already attempts to verify the message, so we can just call super and try the old verifier if it fails.
* | Add parse method to share deserialization logic.Kasper Timm Hansen2015-09-081-19/+12
| | | | | | | | Cuts down on the duplicated reading parts.
* | Add commit in the EncryptedCookieJarKasper Timm Hansen2015-09-081-17/+7
| | | | | | | | Gets rid of the option parsing and makes what the encryptor does stand out.
* | Use commit in the SignedCookieJarKasper Timm Hansen2015-09-081-15/+6
| | | | | | | | Lets us avoid worrying about parsing the options and doing just what we need.
* | Add commit method to share option normalizationKasper Timm Hansen2015-09-081-4/+12
| | | | | | | | Remove the clutter to make PermanentCookieJar's one change stand out.
* | Add AbstractCookieJar class.Kasper Timm Hansen2015-09-081-1/+3
| | | | | | | | Eventually this will be the superclass of all the chained jars.
* | Make `config.force_ssl` less dangerous to try and easier to disableJeremy Daer2015-09-071-36/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | implement abstract store methodsAaron Patterson2015-09-042-5/+5
| | | | | | | | converts old ID methods to the new abstract store methods in Rack
* | stop using deprecated Abstract::ID classAaron Patterson2015-09-042-2/+2
| |
* | stop inheriting from Rack::RequestAaron Patterson2015-09-043-4/+4
| | | | | | | | | | | | 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
* | use `Rack::Utils.unescape_path` to unescape pathsAaron Patterson2015-09-041-3/+3
| | | | | | | | | | | | 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
* | Fix bug where cookies mutated by request were not persistedeileencodes2015-09-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Remove unused requiresMarcin Olichwirowicz2015-08-251-2/+0
| | | | | | | | They are already required in `actionpack/lib/action_dispatch.rb` (L25-L26)
* | Make `assert_index` privateMarcin Olichwirowicz2015-08-251-3/+1
| | | | | | | | | | This `protected` keyword looks like some leftover, since we are not using explicit receiver, this should go under `private`
* | Remove unused block argumentsamitkumarsuroliya2015-08-251-1/+1
| |
* | stop using `@env` in the GET / POST methodsAaron Patterson2015-08-241-2/+4
| | | | | | | | | | I want to implement this with something besides `@env` in the future, so lets stop directly referencing it.
* | use methods on the request object instead of accessing envAaron Patterson2015-08-231-7/+7
| |
* | use `Request#path_info` instead of direct ENV accessAaron Patterson2015-08-231-1/+1
| | | | | | | | | | we already have a request, so we should use the methods on the request to access the path info information
* | remove env access from debug_exceptionsAaron Patterson2015-08-231-10/+9
| | | | | | | | Creates fewer request objects and helps to abstract away from internals
* | convert more `@env` access to get / set headerAaron Patterson2015-08-231-11/+13
| |
* | remove usage of `@env`Aaron Patterson2015-08-231-3/+5
| | | | | | | | | | try to remove dependencies on `@env` so we can have more flexible internals
* | use a request object in the session middlewareAaron Patterson2015-08-223-22/+26
| | | | | | | | | | This commit allows us to use one request object rather than allocating multiple request objects to deal with the session.
* | Cleanup ActionDispatch:ParamsParserMarcin Olichwirowicz2015-08-171-2/+11
| |
* | finish deprecating handling strings and symbolsAaron Patterson2015-08-071-19/+4
| | | | | | | | | | since we only work with instances of classes, it greatly simplifies the `Middleware` implementation.
* | Using strings or symbols for middleware class names is deprecated.Aaron Patterson2015-08-071-18/+25
| | | | | | | | | | | | | | | | | | | | Convert things like this: middleware.use "Foo::Bar" to this: middleware.use Foo::Bar
* | simplify the Middleware constructorAaron Patterson2015-08-071-10/+13
| | | | | | | | | | | | 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.
* | use Proc.new to reduce some conditionalsAaron Patterson2015-08-071-3/+1
| | | | | | | | | | | | 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.
* | refactor param parsing middleware to use request objectsAaron Patterson2015-08-071-10/+9
| | | | | | | | | | this is another place that we should stop directly accessing the env hash and let the request object take care of that for us
* | move flash hash access to methods on the request objectAaron Patterson2015-08-071-2/+11
| |
* | use a request object to access info from env in GetIpAaron Patterson2015-08-061-10/+12
| | | | | | | | | | | | | | 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.
* | ask the request if we should show exceptionsAaron Patterson2015-08-062-4/+6
| | | | | | | | | | hide the env key in the request object so that other code doesn't need to know.
* | ExceptionWrapper doesn't need to know about `env`Aaron Patterson2015-08-063-9/+7
| | | | | | | | | | | | ExceptionWrapper only cares about the backtrace cleaner, so lets just pass the cleaner to the wrapper. It does not need to know that env exists or what key the backtrace cleaner is stored in