| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | |
| | | |
| | | | |
As we all know that Accessing mime types via constants is deprecated. Now, we are using `Mime::Type[:JSON]` instead of `Mime::JSON`
|
| | | |
| | | |
| | | |
| | | |
| | | | |
The flash middleware shouldn't know how to look up the session object.
Just ask the request for that information.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
We can know whether or not there is a content type object, and just exit
early. There is no need to `try` so hard.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Synonyms are always a list of strings, and we have access to the
internal string representation, so we can avoid allocating new arrays.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
Now that `all` has it's own object, we don't need the html_types Set.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
This class gives us the `all?` predicate method that returns true
without hitting method missing
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Since Mime::Type implements `method_missing`, and `blank?` triggers it's
positive branch:
https://github.com/rails/rails/blob/f9dda1567ea8d5b27bd9d66ac5a8b43dc67a6b7e/actionpack/lib/action_dispatch/http/mime_type.rb#L342
We should stop calling `blank?`.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Changes `Mimes` to compose a set rather than inherit from array. With
this change we don't need to define as many methods, so ISEQ memory is
saved. Also it is clear which methods break the set cache.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
We should be asking the mime type method for the mime objects rather
than via const lookup
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We don't want to manage a list of constants on `Mime::`. Managing
constants is strange because it will break method caches, not to mention
looking up by a constant could cause troubles. For example suppose
there is a top level constant `HTML`, but nobody registers the HTML mime
type and someone accesses `Mime::HTML`. Instead of getting an error
about how the mime type doesn't exist, instead you'll get the top level
constant.
So, instead of directly accessing the constants, change this:
Mime::HTML
To this:
Mime::Type[:HTML]
|
| | | |
| | | |
| | | |
| | | | |
Now we don't have to look it up with a `const_get`.
|
| | | |
| | | |
| | | | |
forgotten end of the block
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
This is an instance method on the request object now so we don't need it
anymore
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
we need to be more specific about exception handling when dealing with
the parse strategies. The calls to `return yield` can also raise an
exception, but we don't want to handle that in *this* code.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
`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
|
| | | |
| | | |
| | | |
| | | |
| | | | |
since there is only one "default" strategy now, we can just use the
block parameter for that.
|
|/ / /
| | |
| | |
| | |
| | | |
All parameter parsing should be on the request object because the
request object is the object that we ask for parameters.
|
| | | |
|
| | |
| | |
| | |
| | | |
this commit removes some direct access to `env`.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
`Rack::Session::Abstract::ID` is now deprecated and
`Rack::Session::Abstract::Persisted` should be used instead.
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
This method is specifically about the content type so lets remove the
parameter.
|
| | |
| | |
| | |
| | |
| | | |
create a singleton content type that just has nils, so that we don't
have to allocate a content type object all the time.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If someone sets just a charset, but depends on the implicit type from
rendering, this will store a strange content type header that looks like
this: `; charset=blah`. This is so that when the content type header
is parsed again, it will return nil for the actual type.
|
| | |
| | |
| | |
| | |
| | | |
It turns out that the response object never really cares what the mime
type object is, so just use the string.
|
| | |
| | |
| | |
| | | |
pull content-type setting to a private method to dry it up.
|
| | |
| | |
| | |
| | |
| | | |
Instead of storing content type information in an ivar and a header,
lets move to just store the content type info in just the header.
|
| | |
| | |
| | |
| | | |
we'll use this method later to lazily parse content type headers.
|
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | | |
bernerdschaefer/bs-polymorphic-url_for-dups-arguments
`url_for` does not modify polymorphic options
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The `url_for` methods in `actionpack` and `actionview`
now make a copy of the provided options
before generating polymorphic paths or URLs.
The bug in the previous behavior
is most noticeable in a case like:
url_options = [:new, :post, param: 'value']
if current_page?(url_options)
css_class = "active"
end
link_to "New Post", url_options, class: css_class
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| | | | |
|