2

I'm receiving a 302 response for Task Queues on Google App Engine (Standard), only in production. My local environment processes them fine. (dev_appserver.py) I'm running Laravel 4.2.

I've created a queue.yaml file and deployed that as well

queue:
- name: default
  rate: 1/s
  retry_parameters:
    task_retry_limit: 3

My route for tasks looks like

Route::post('tasks', array('as' => 'tasks', function(){
    return Queue::marshal();
}));

Log

2018-08-31 12:30:09.256 EDT
POST
302
1,003 B
407 ms
AppEngine-Google; (+http://code.google.com/appengine)
/tasks
btaylor507
  • 211
  • 1
  • 13
  • 1
    What is the URL of the very next log entry (the one redirected to)? Check to see if the URL redirects to one with a trailing slash. By chance, do you have any rerouter going from http: to https:? – GAEfan Aug 31 '18 at 17:37
  • That’s exactly it. I found i couldn’t force ssl on that route. Thank you for taking the time to help. You’re spot on. – btaylor507 Sep 01 '18 at 01:28
  • 1
    I guess I should make this an answer then, for posterity. – GAEfan Sep 01 '18 at 03:13

1 Answers1

5

Make sure you don't have any rerouter script redirecting http:// requests to https://. If you do, consider filtering for taskqueue requests, such as (Python/Flask logic shown. Modify to suit your language):

if not 'AppEngine-Google' in request.environ.get('HTTP_USER_AGENT', 'fake'):
GAEfan
  • 11,244
  • 2
  • 17
  • 33