8

I am trying to move my django project from an apache setup over to heroku. At this point, everything seems to be working fine except for an issue I am having with using the PATCH Http Method (which I use in conjuction with django-tastypie).

I have a piece of middleware that allows this method and it worked on the apache server I had before. Now all I get is a 405 (METHOD_NOT_ALLOWED) error. The common HTTP methods still work (GET, POST, DELETE, POST). I also have read that nginx doesn't support OPTIONS (and maybe PATCH requests?) by default and some configuring has to be done. From what I have read, nginx returns a similar 405 error for OPTIONS method requests. I am also pretty sure heroku uses an nginx frontend, so that could be the issue.

This leads me to my next issue: I have no idea how to add my own headers to it because that is all controlled by heroku. Does anyone know exactly what the issue is? Is there any way, aside from abandoning the PATCH method (which makes things much more convenient), to get the PATCH method to work on heroku?

tonyl7126
  • 1,478
  • 1
  • 13
  • 18

1 Answers1

8

Patch is currently not supported on Heroku. It is not due to an nginx issue, but rather due to an issue in the routing layer. It is something Heroku is currently working on, but there is no ETA on it being available. Additionally you do not have the ability to add custom headers as these are controlled for you.

CraigKerstiens
  • 5,708
  • 1
  • 23
  • 27
  • I tried to create this support ticket with Heroku, but their support system replied with "We're sorry, but something went wrong." So I'll post it here. Heroku support, HTTP PATCH requests are working in my local development instance but failing on my Heroku staging instance. Can you confirm that Heroku can or cannot support HTTP PATCH requests? I found this Stack Overflow (SO) question from April: http://stackoverflow.com/questions/10069871/heroku-and-django-with-405-error – Erik Sep 19 '12 at 16:51
  • which suggests that this is a limitation of Heroku's routing layer. I have found no mention of it in the Heroku documentation. The SO question also suggests that custom header won't work with Heroku, but I have used them with no issue. – Erik Sep 19 '12 at 16:53