public function route(string $uri, Response $response) : void
    {
        $this->reroutes ++;
        if ($this->reroutes > 10) {
            FW()->log->critical('The request for ' . $uri . ' has redirected too many times!');
            $response->setStatusCode(508);
            return;
        }
        // Process the URI
        $url_array = $this->processURL($uri);
        // Extract the ISO locale code from the beginning
        $this->extractLocale($url_array, $response);
        // Remove the extension from the filename
        $filename = array_pop($url_array);
        $extension = pathinfo($filename, PATHINFO_EXTENSION);
        $filename = pathinfo($filename, PATHINFO_FILENAME);
        $url_array[] = $filename;
        // Save the resolved path and extension
        $this->path = implode('/', $url_array);
        FW()->log->debug('Resolved Path: ' . $this->path);
        $this->extension = $extension;
        // Get the module and action if provided. TODO: This needs a try/catch
        $variables = $this->matchRoute($url_array);
        $response->resetMCAValues();
        if (isset($variables['module'])) {
            $response->setModule($variables['module']);
            unset($variables['module']);
        }
        if (isset($variables['controller'])) {
            $response->setController($variables['controller']);
            unset($variables['controller']);
        }
        if (isset($variables['action'])) {
            $response->setAction($variables['action']);
            unset($variables['action']);
        }
        // Store the variables for retrieval
        if (count($variables) > 0) {
            $response->setVariables($variables);
        }
    }