Search code examples
ruby-on-railsamazon-ec2amazon-s3engineyardcustom-headers

Custom headers are not working in Amazon EC2 server


We are building an API and using Rest Console extension of Chrome for testing purpose. We have deployed our Application on Heroku server for debugging and on EC2 server as well. It is giving correct results on Heroku server with Custom headers. But for EC2 server, the custom headers are not passing. Because of which the correct results are not displayed on the EC2 server. While checking the EC2 server log file we found that the custom headers does not exist in HTTP Header.

From Local system we are requesting using Restclient:

RestClient.get('http://ec2-54-225-122-111.compute-1.amazonaws.com/method_name',{"Authorization"=> authorization_element,"custom_header1"=>val1,"custom_header2"=>val2})

Is there any settings we need to do in order to get custom HTTP Header in Amazon AWS server?

EDIT: I'm using EngineYard for deployment process.


Solution

  • I got the solution by passing the names without underscore.

    I was passing the custom header with name having underscore like custom_header1="some value". And from here, I come to know that underscore is not allowed although hyphen is allowed which is further converted into underscore.