aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/api/controllers/Links.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-10-29 16:03:07 +0100
committerGitHub <noreply@github.com>2020-10-29 16:03:07 +0100
commitdff039092d180fffa89e7d88f7a4b7bc24dfc80f (patch)
tree7430bf86688b136e442774b1035a9c3be2418875 /application/api/controllers/Links.php
parent14c9370b4f712c8f5b48d46535cc3e8e5506c68a (diff)
parentb37ca790729125fa0df956220a4062f1d34c57e7 (diff)
downloadShaarli-dff039092d180fffa89e7d88f7a4b7bc24dfc80f.tar.gz
Shaarli-dff039092d180fffa89e7d88f7a4b7bc24dfc80f.tar.zst
Shaarli-dff039092d180fffa89e7d88f7a4b7bc24dfc80f.zip
Merge pull request #1616 from dimtion/fix-api-redirect
API postLink: change relative path to absolute path
Diffstat (limited to 'application/api/controllers/Links.php')
-rw-r--r--application/api/controllers/Links.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/application/api/controllers/Links.php b/application/api/controllers/Links.php
index 73a1b84e..6bf529e4 100644
--- a/application/api/controllers/Links.php
+++ b/application/api/controllers/Links.php
@@ -131,7 +131,7 @@ class Links extends ApiController
131 131
132 $this->bookmarkService->add($bookmark); 132 $this->bookmarkService->add($bookmark);
133 $out = ApiUtils::formatLink($bookmark, index_url($this->ci['environment'])); 133 $out = ApiUtils::formatLink($bookmark, index_url($this->ci['environment']));
134 $redirect = $this->ci->router->relativePathFor('getLink', ['id' => $bookmark->getId()]); 134 $redirect = $this->ci->router->pathFor('getLink', ['id' => $bookmark->getId()]);
135 return $response->withAddedHeader('Location', $redirect) 135 return $response->withAddedHeader('Location', $redirect)
136 ->withJson($out, 201, $this->jsonStyle); 136 ->withJson($out, 201, $this->jsonStyle);
137 } 137 }