Fix loading issues in the local environment

When running Monorail locally issues wouldn't load because the internal
requests to the search endpoints were made via https and should be made
via http instead.

GitOrigin-RevId: 94d17b5cf8026f24c979bc9e922809312afb6b17
diff --git a/search/frontendsearchpipeline.py b/search/frontendsearchpipeline.py
index b606672..ac7fd4c 100644
--- a/search/frontendsearchpipeline.py
+++ b/search/frontendsearchpipeline.py
@@ -950,8 +950,10 @@
     UserRPC for the created RPC call.
   """
   shard_id, subquery = shard_key
+  protocol = 'https' if not settings.local_mode else 'http'
   backend_host = modules.get_hostname(module='default')
-  url = 'https://%s%s' % (
+  url = '%s://%s%s' % (
+      protocol,
       backend_host,
       framework_helpers.FormatURL(
           [],
@@ -980,8 +982,9 @@
     project_id, logged_in_user_id, shard_id, invalidation_timestep,
     deadline=None, failfast=True):
   """Ask a backend to query one shard of the database."""
+  protocol = 'https' if not settings.local_mode else 'http'
   backend_host = modules.get_hostname(module='default')
-  url = 'https://%s%s' % (backend_host, framework_helpers.FormatURL(
+  url = '%s://%s%s' % (protocol, backend_host, framework_helpers.FormatURL(
       None, urls.BACKEND_NONVIEWABLE,
       project_id=project_id or '',
       logged_in_user_id=logged_in_user_id or '',