$current_url = \Drupal\Core\Url::fromRoute('<current>', array(), array("absolute" => TRUE))->toString();
View the discussion thread.