1. 03 12月, 2019 1 次提交
  2. 14 6月, 2019 1 次提交
    • A
      Keep part when scope option has value · 85855d63
      Alberto Almagro 提交于
      When a route was defined within an optional scope, if that route didn't
      take parameters the scope was lost when using path helpers. This patch
      ensures scope is kept both when the route takes parameters or when it
      doesn't.
      
      Fixes #33219
      85855d63
  3. 04 4月, 2019 1 次提交
  4. 03 4月, 2019 1 次提交
  5. 02 4月, 2019 1 次提交
  6. 01 4月, 2019 1 次提交
  7. 26 3月, 2019 1 次提交
  8. 18 1月, 2019 1 次提交
  9. 21 11月, 2018 1 次提交
  10. 28 9月, 2018 2 次提交
    • S
      Fixing an edge case when using objects as constraints · d043920e
      Simon Courtois 提交于
      This PR fixes an issue when the following situation occurs.
      If you define a class like this
      
          class MyConstraint
            def call(*args)
              # for some reason this is defined
            end
      
            def matches?(*args)
              # checking the args
            end
          end
      
      and try to use it as a constraint
      
          get "/", to: "home#show", constraints: MyConstraint.new
      
      if its `matches?` method returns `false` there will be an error for the
      mapper will ask for the constraint arity, thinking it is a proc, lambda
      or method.
      
      This PR checks for the presence of the `arity` method on the constraint
      calling it only if present, preventing the error while keeping the basic
      behavior.
      d043920e
    • G
      Fix optionally scoped root route unscoped access · 7670d609
      Gannon McGibbon 提交于
      7670d609
  11. 13 5月, 2018 1 次提交
  12. 19 4月, 2018 1 次提交
  13. 17 2月, 2018 1 次提交
  14. 26 1月, 2018 1 次提交
  15. 14 12月, 2017 1 次提交
  16. 28 11月, 2017 1 次提交
  17. 25 9月, 2017 1 次提交
    • M
      Add key rotation cookies middleware · 8b0af54b
      Michael Coyne 提交于
      Using the action_dispatch.cookies_rotations interface, key rotation is
      now possible with cookies. Thus the secret_key_base as well as salts,
      ciphers, and digests, can be rotated without expiring sessions.
      8b0af54b
  18. 02 8月, 2017 2 次提交
    • E
      Clarify route encoding test · 789f3be0
      eileencodes 提交于
      Since this test changed in 92209356 I noticed that it really doesn't make
      sense anymore. I split the tests into 2 groups to explain what each one
      does.
      
      First these routes should throw a `bad_request` when the encoding isn't
      valid. We're expecting UTF8 encoding and passing binary, that should be
      a bad request.
      
      For the second test we are setting the `show` route to set
      `self.binary_params_for?` for that route which will convert the
      parameters and return a `:ok` instead of a `:bad_request`.
      789f3be0
    • E
      Path parameters should default to UTF8 · 92209356
      eileencodes 提交于
      This commit changes the behavior such the path_params now default to
      UTF8 just like regular parameters. This also changes the behavior such
      that if a path parameter contains invalid UTF8 it returns a 400 bad
      request. Previously the behavior was to encode the path params as binary
      but that's not the same as query params.
      
      So this commit makes path params behave the same as query params.
      
      It's important to test with a path that's encoded as binary because
      that's how paths are encoded from the socket. The test that was altered
      was changed to make the behavior for bad encoding the same as query
      params. We want to treat path params the same as query params. The params
      in the test are invalid UTF8 so they should return a bad request.
      
      Fixes #29669
      
      *Eileen M. Uchitelle, Aaron Patterson, & Tsukuru Tanimichi*
      92209356
  19. 29 7月, 2017 1 次提交
  20. 02 7月, 2017 1 次提交
  21. 01 7月, 2017 1 次提交
  22. 16 5月, 2017 1 次提交
  23. 19 4月, 2017 1 次提交
  24. 18 4月, 2017 1 次提交
    • A
      Use more specific check for :format in route path · 8776a713
      Andrew White 提交于
      The current check for whether to add an optional format to the path
      is very lax and will match things like `:format_id` where there are
      nested resources, e.g:
      
          resources :formats do
            resources :items
          end
      
      Fix this by using a more restrictive regex pattern that looks for
      the patterns `(.:format)`, `.:format` or `/` at the end of the path.
      Note that we need to allow for multiple closing parenthesis since
      the route may be of this form:
      
          get "/books(/:action(.:format))", controller: "books"
      
      This probably isn't what's intended since it means that the default
      index action route doesn't support a format but we have a test for
      it so we need to allow it.
      
      Fixes #28517.
      8776a713
  25. 16 3月, 2017 1 次提交
    • A
      Remove unnecessary params munging · 886085d6
      Andrew White 提交于
      In 9b654d47 some params munging was added to ensure that they were
      set whenever `recognize_path` would call either a proc or callable
      constraint. Since we no longer mutate the environment hash within
      the method it's now unnecessary and actually causes params to leak
      between route matches before checking constraints.
      
      Fixes #28398.
      886085d6
  26. 26 2月, 2017 1 次提交
    • A
      Commit flash changes when using a redirect route. · 558336ee
      Andrew White 提交于
      In ca324a0d the flash middleware was effectively removed by its
      constructor returning the app it was passed and the `commit_flash`
      call was moved to the `ActionController::Metal#dispatch` method.
      This broke any redirect routes that modified the flash because the
      redirect happens before `dispatch` gets called.
      
      To fix it, this commit adds a `commit_flash` call in the `serve`
      method of `ActionDispatch::Routing::Redirect`.
      
      Fixes #27992.
      558336ee
  27. 05 1月, 2017 1 次提交
  28. 25 12月, 2016 1 次提交
  29. 29 10月, 2016 1 次提交
  30. 10 10月, 2016 2 次提交
  31. 03 10月, 2016 1 次提交
    • C
      Show an "unmatched constraints" error for mismatching and present params · 0b32e2df
      Chris Carter 提交于
      Currently a misleading "missing required keys" error is thrown when a param
      fails to match the constraints of a particular route. This commit ensures that
      these params are recognised as unmatching rather than missing.
      
      Note: this means that a different error message will be provided between
      optimized and non-optimized path helpers, due to the fact that the former does
      not check constraints when matching routes.
      
      Fixes #26470.
      0b32e2df
  32. 03 9月, 2016 1 次提交
    • Y
      rename test method to avoid overriding · f2826262
      yuuji.yaginuma 提交于
      This removes the following warning.
      
      ```
      ./test/dispatch/routing_test.rb:3696: warning: method redefined; discarding old test_namespaced_roots
      ./test/dispatch/routing_test.rb:1632: warning: previous definition of test_namespaced_roots was here
      ```
      f2826262
  33. 02 9月, 2016 1 次提交
  34. 29 8月, 2016 1 次提交
    • R
      Fix nested multiple roots · 2ea66fc6
      Ryo Hashimoto 提交于
      The PR #20940 enabled the use of multiple roots with different constraints
      at the top level but unfortunately didn't work when those roots were inside
      a namespace and also broke the use of root inside a namespace after a top
      level root was defined because the check for the existence of the named route
      used the global :root name and not the namespaced name.
      
      This is fixed by using the name_for_action method to expand the :root name to
      the full namespaced name. We can pass nil for the second argument as we're not
      dealing with resource definitions so don't need to handle the cases for edit
      and new routes.
      
      Fixes #26148.
      2ea66fc6
  35. 18 8月, 2016 1 次提交
    • R
      Push :defaults extraction down one level · 4c91c442
      Rafael Mendonça França 提交于
      Since e852daa6 only the verb methods
      where extracting the defaults options. It was merged a fix for the
      `root` method in 31fbbb7f but `match`
      was still broken since `:defaults` where not extracted.
      
      This was causing routes defined using `match` and having the `:defaults`
      keys to not be recognized.
      
      To fix this it was extracted a new private method with the actual
      content of `match` and the `:defaults` extracting was moved to `match`.
      4c91c442
  36. 16 8月, 2016 1 次提交
  37. 07 8月, 2016 1 次提交