views:

396

answers:

1

I'm using Heroku (heroku.com) to deploy my rails application, and am building an iPhone client to interface with it. My intention was to pass the unique device identifier of the phone to the app as a HTTP header for authentication. When I test locally, my headers come through fine, but on Heroku it seems to strip out my custom header. I verified with a ruby script:

url = URI.parse('http://#{myapp}.heroku.com/')
#url = URI.parse('http://localhost:3000/')
req = Net::HTTP::Post.new(url.path)
#bogus params
req.set_form_data({'from'=>'2005-01-01', 'to'=>'2005-03-31'}, ';')
#device header
req['HTTP_DEVICE_UDID'] = "XXXXXX"
res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }

Against my local server, the header is there, but on heroku it is not.

Any ideas?

Thanks,

Jeremy

+1  A: 

Have you tried passing that as an X- header, i.e. X-HTTP-DEVICE-UDID? Most custom or non-standard HTTP headers are passed as X- headers.

slillibri
Thanks! Works great.
Jeremy