Skip to content
  • Yuki Nishijima's avatar
    616de8f9
    Fix a bug where malformed query strings lead to 500 · 616de8f9
    Yuki Nishijima authored
    If a request contains an malformed query string, Rails responds with an
    internal server error insted of a bad request. This is because
    ActionDispatch::PublicExceptions calls request#formats and it raises an
    ActionController::BadRequest from inside ActionDispatch::ShowExceptions,
    hence the 500 error.
    
    This commit changes PublicExceptions to catch BadRequest if raised from
    request#formats.
    
    fixes #11502
    616de8f9
    Fix a bug where malformed query strings lead to 500
    Yuki Nishijima authored
    If a request contains an malformed query string, Rails responds with an
    internal server error insted of a bad request. This is because
    ActionDispatch::PublicExceptions calls request#formats and it raises an
    ActionController::BadRequest from inside ActionDispatch::ShowExceptions,
    hence the 500 error.
    
    This commit changes PublicExceptions to catch BadRequest if raised from
    request#formats.
    
    fixes #11502
Loading