0
votes

I am receiving the below error for my rails app via Exception Notification gem that sends an email.

The app has devise for authentication and there is a /users/sign_in path The www.example.com (fake) domain is not ours, but for some reason it is making get requests against our app at that path that is causing an exception. I can visit the /users/sign_in path of our app and I will see the signin page. We have recently changed isp's and received a new ip and there might be a dns config somewhere that has not updated and is sending the other domain to our ip. I have tried to simulate the error locally by making a curl get request to the app in development with the parameters below but also get the html of the signin page back (no exception).

curl GET "http://localhost:3000/users/sign_in/?action=new&controller=sessions"

My question is how would I simulate this error using curl (or any other means)?

An ActionController::UnknownFormat occurred in sessions#new:

ActionController::UnknownFormat


Request:

  • URL : http://www.example.com/users/sign_in
  • HTTP Method: GET
  • IP address : XXX.XXX.XXX.XXX
  • Parameters : {"action"=>"new", "controller"=>"sessions"}
  • Timestamp : 05/08/2015 06:20
  • Server : XXX
  • Rails root : /home/deploy/rails/XXX
  • Process: 9618

Session:

  • session id: nil
  • data: #

Environment:

  • HTTP_ACCEPT : Accept: /
  • HTTP_CONNECTION : close
  • HTTP_HOST : www.example.com
  • HTTP_REFERER : http://www.example.com/
  • HTTP_USER_AGENT : Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; WebSaver; .NET CLR 2.0.50727)
  • HTTP_VERSION : HTTP/1.0
  • HTTP_X_FORWARDED_FOR : XXX.XXX.XXX.XXX, XXX.XXX.XXX.XXX
  • HTTP_X_FORWARDED_PROTO : http
  • ORIGINAL_FULLPATH : /users/sign_in
  • ORIGINAL_SCRIPT_NAME :
  • PATH_INFO : /users/sign_in
  • QUERY_STRING :
  • REMOTE_ADDR : 127.0.0.1
  • REQUEST_METHOD : GET
  • REQUEST_PATH : /users/sign_in
  • REQUEST_URI : /users/sign_in
  • ROUTES_51525820_SCRIPT_NAME :
  • SCRIPT_NAME :
  • SERVER_NAME : www.example.com
  • SERVER_PORT : 80
  • SERVER_PROTOCOL : HTTP/1.0
  • SERVER_SOFTWARE : Unicorn 4.8.3

Blockquote

1

1 Answers

1
votes

There is a problem with Accept header (on the client's side).

You can simulate it with -H option:

curl -XGET -H "Accept: /" "http://localhost:3000/users/sign_in/"

No need for action=new&controller=sessions part: there parameters are filled in by your routes.