def call(env)
      organization = detect_current_organization(env)
      if organization
        env["decidim.current_organization"] = organization
        @app.call(env)
      else
        organization = find_secondary_host_org(env)
        return @app.call(env) unless organization

        location = new_location_for(env, organization.host)

        [301, { "Location" => location, "Content-Type" => "text/html", "Content-Length" => "0" }, []]
      end
    end
def call(env)
      organization = detect_current_organization(env)
      if organization
        env["decidim.current_organization"] = organization
        @app.call(env)
      else
        organization = find_secondary_host_org(env)
        return @app.call(env) unless organization

        location = new_location_for(env, organization.host)

        [301, { "Location" => location, "Content-Type" => "text/html", "Content-Length" => "0" }, []]
      end
    end
Initializes the Rack Middleware.

 app - The Rack application
 Main entry point for a Rack Middleware.

 env - A Hash.