1. 04 9月, 2014 1 次提交
  2. 02 9月, 2014 1 次提交
  3. 01 9月, 2014 1 次提交
    • S
      Allow polymorphic routes with nil when a route can still be drawn · 2fae37f0
      Sammy Larbi 提交于
      Suppose you have two resources routed in the following manner:
      
      ```ruby
      resources :blogs do
        resources :posts
      end
      
      resources :posts
      ```
      
      When using polymorphic resource routing like `url_for([@blog, @post])`, and `@blog` is `nil` Rails should still try to match the route to the top-level posts resource.
      
      Fixes #16754
      2fae37f0
  4. 30 8月, 2014 1 次提交
  5. 29 8月, 2014 1 次提交
    • P
      Don't rescue IPAddr::InvalidAddressError · a59a9b7f
      Peter Suschlik 提交于
      IPAddr::InvalidAddressError does not exist in Ruby 1.9.3
      and fails for JRuby in 1.9 mode.
      
      As IPAddr::InvalidAddressError is a subclass of ArgumentError
      (via IPAddr::Error) just rescuing ArgumentError is fine.
      a59a9b7f
  6. 28 8月, 2014 3 次提交
    • A
      Test everything · b7d649d2
      Akira Matsuda 提交于
      This actually was testing test everything, so why not do it simpler?
      b7d649d2
    • A
      e969c928
    • S
      Refactor out Dir.glob from ActionDispatch::Static · 0b1a87f7
      schneems 提交于
      Dir.glob can be a security concern. The original use was to provide logic of fallback files. Example a request to `/` should render the file from `/public/index.html`. We can replace the dir glob with the specific logic it represents. The glob {,index,index.html} will look for the current path, then in the directory of the path with index file and then in the directory of the path with index.html. This PR replaces the glob logic by manually checking each potential match. Best case scenario this results in one less file API request, worst case, this has one more file API request.
      
      Related to #16464
      
      Update: added a test for when a file of a given name (`public/bar.html` and a directory `public/bar` both exist in the same root directory. Changed logic to accommodate this scenario.
      0b1a87f7
  7. 27 8月, 2014 2 次提交
  8. 25 8月, 2014 2 次提交
  9. 23 8月, 2014 1 次提交
  10. 22 8月, 2014 1 次提交
    • S
      Refactor ActionDispatch::RemoteIp · f9a84bb2
      Sam Aarons 提交于
      Refactored IP address checking in ActionDispatch::RemoteIp to rely on
      the IPAddr class instead of the unwieldly regular expression to match
      IP addresses. This commit keeps the same api but allows users to pass
      IPAddr objects to config.action_dispatch.trusted_proxies in addition
      to passing strings and regular expressions.
      
      Example:
      
          # config/environments/production.rb
          config.action_dispatch.trusted_proxies = IPAddr.new('4.8.15.0/16')
      f9a84bb2
  11. 21 8月, 2014 3 次提交
    • G
      Improve router test. · 92120426
      Guo Xiang Tan 提交于
      We should assert that routes will not be recognized if the verbs do
      not match.
      92120426
    • G
      Avoid duplicating routes for HEAD requests. · d3eb92d9
      Guo Xiang Tan 提交于
      Follow up to rails#15321
      
      Instead of duplicating the routes, we will first match the HEAD request to
      HEAD routes. If no match is found, we will then map the HEAD request to
      GET routes.
      d3eb92d9
    • S
      Enable gzip compression by default · cfaaacd9
      schneems 提交于
      If someone is using ActionDispatch::Static to serve assets and makes it past the `match?` then the file exists on disk and it will be served. This PR adds in logic that checks to see if the file being served is already compressed (via gzip) and on disk, if it is it will be served as long as the client can handle gzip encoding. If not, then a non gzip file will be served.
      
      This additional logic slows down an individual asset request but should speed up the consumer experience as compressed files are served and production applications should be delivered with a CDN. This PR allows a CDN to cache a gzip file by setting the `Vary` header appropriately. In net this should speed up a production application that are using Rails as an origin for a CDN. Non-asset request speed is not affected in this PR.
      cfaaacd9
  12. 20 8月, 2014 5 次提交
  13. 19 8月, 2014 9 次提交
  14. 18 8月, 2014 9 次提交