diff --git a/AppServer/google/appengine/tools/devappserver2/module.py b/AppServer/google/appengine/tools/devappserver2/module.py index 77753bd57e..98ae1f5465 100644 --- a/AppServer/google/appengine/tools/devappserver2/module.py +++ b/AppServer/google/appengine/tools/devappserver2/module.py @@ -581,7 +581,7 @@ def _handle_request_impl(self, environ, start_response, inst=None, try: environ['SERVER_PORT'] = environ['HTTP_HOST'].split(':')[1] except IndexError: - scheme = environ['HTTP_X_FORWARDED_PROTO'] + scheme = environ.get('HTTP_X_FORWARDED_PROTO', 'http') if scheme == 'http': environ['SERVER_PORT'] = 80 else: diff --git a/AppTaskQueue/appscale/taskqueue/push_worker.py b/AppTaskQueue/appscale/taskqueue/push_worker.py index 70fdeed0bd..e38567c83e 100644 --- a/AppTaskQueue/appscale/taskqueue/push_worker.py +++ b/AppTaskQueue/appscale/taskqueue/push_worker.py @@ -152,20 +152,8 @@ def execute_task(task, headers, args): update_task(args['task_name'], TASK_STATES.FAILED) return - # Targets do not get X-Forwarded-Proto from nginx, they use haproxy port. - headers['X-Forwarded-Proto'] = url.scheme - if url.scheme == 'http': - connection = httplib.HTTPConnection(remote_host, url.port) - elif url.scheme == 'https': - connection = httplib.HTTPSConnection(remote_host, url.port) - else: - logger.error("Task %s tried to use url scheme %s, " - "which is not supported." % ( - args['task_name'], url.scheme)) - - skip_host = False - if 'host' in headers or 'Host' in headers: - skip_host = True + # Tasks should use HTTP to bypass scheme redirects since they use HAProxy. + connection = httplib.HTTPConnection(remote_host, url.port) skip_accept_encoding = False if 'accept-encoding' in headers or 'Accept-Encoding' in headers: @@ -173,7 +161,6 @@ def execute_task(task, headers, args): connection.putrequest(method, urlpath, - skip_host=skip_host, skip_accept_encoding=skip_accept_encoding) # Update the task headers @@ -181,6 +168,14 @@ def execute_task(task, headers, args): headers['X-AppEngine-TaskExecutionCount'] = str(task.request.retries) for header in headers: + # Avoid changing the host header from the HAProxy location. Though GAE + # supports host-based routing, we need to make some additional changes + # before we can behave in a similar manner. Using the HAProxy location + # for the host header allows the dispatcher to try extracting a port, + # which it uses to set environment variables for the request. + if header == b'Host': + continue + connection.putheader(header, headers[header]) if 'content-type' not in headers or 'Content-Type' not in headers: diff --git a/Hermes/setup.py b/Hermes/setup.py index 22dfc96283..10e1272e94 100644 --- a/Hermes/setup.py +++ b/Hermes/setup.py @@ -15,7 +15,7 @@ 'kazoo', 'tornado', 'psutil==5.6.3', - 'attrs>=18.1.0', + 'attrs>=18.1.0,<19.2.0', # 19.2.0 removed "convert" attribute. 'mock', ], test_suite='appscale.hermes', diff --git a/RELEASE b/RELEASE index 6623b5fd0f..0b2fd384f4 100644 --- a/RELEASE +++ b/RELEASE @@ -5,6 +5,13 @@ /_/ |_/ .___/ .___//____/\___/\__,_/_/ \___/ /_/ /_/ +AppScale version 3.8.1, released October 2019 +Highlights of features and defects fixed in this release: + - Fixes a regression in the 3.8 release where push tasks could not be executed + if the task URL had "secure: always" set. + +Known Issues: + AppScale version 3.8.0, released September 2019 Highlights of features and defects fixed in this release: - Login continue scheme diff --git a/VERSION b/VERSION index ae30a4da65..0c1ca211cc 100644 --- a/VERSION +++ b/VERSION @@ -4,4 +4,4 @@ / ___ |/ /_/ / /_/ /___/ / /__/ /_/ / // __/ /_/ |_/ .___/ .___//____/\___/\__,_/_/ \___/ /_/ /_/ -AppScale version 3.8.0 +AppScale version 3.8.1