]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/api/controllers/Links.php
Merge pull request #1616 from dimtion/fix-api-redirect
[github/shaarli/Shaarli.git] / application / api / controllers / Links.php
index 73a1b84e1727e1a4567e53ec9db6fe1299ce2b39..6bf529e4a570a3ff5f789f2de34045946205cd67 100644 (file)
@@ -131,7 +131,7 @@ class Links extends ApiController
 
         $this->bookmarkService->add($bookmark);
         $out = ApiUtils::formatLink($bookmark, index_url($this->ci['environment']));
-        $redirect = $this->ci->router->relativePathFor('getLink', ['id' => $bookmark->getId()]);
+        $redirect = $this->ci->router->pathFor('getLink', ['id' => $bookmark->getId()]);
         return $response->withAddedHeader('Location', $redirect)
                         ->withJson($out, 201, $this->jsonStyle);
     }