Bugzilla – Attachment 71244 Details for
Bug 20134
Remove /api/v1/app.pl from the generated URLs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20134: Remove /api/v1/app.pl from the generated URLs
Bug-20134-Remove-apiv1apppl-from-the-generated-URL.patch (text/plain), 1.64 KB, created by
Julian Maurice
on 2018-02-06 08:36:24 UTC
(
hide
)
Description:
Bug 20134: Remove /api/v1/app.pl from the generated URLs
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2018-02-06 08:36:24 UTC
Size:
1.64 KB
patch
obsolete
>From fef893a7e1f09d206b5932ff982ab0bd1bdbb749 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 5 Feb 2018 10:28:37 -0300 >Subject: [PATCH] Bug 20134: Remove /api/v1/app.pl from the generated URLs > >This patch removes the /api/v1/app.pl prefix from generated baseUrl. >It has the consequence of hardcoding / as the base path for the API. > >This is ok because we don't currently support mounting Koha pieces in >different than hardcoded paths (/cgi-bin/koha?), but certainly worth >mentioning because this will need to depend on a syspref or config entry >when someone chages this behviour. > >To test: >- On master, point your browser to: > http://kohadev.mydnsname.org:8080/api/v1/ >=> FAIL: basePath looks like /api/v1/app.pl/api/v1 >- Apply this patch >- Restart memcached and plack: > $ restart_all >or > $ sudo systemctl restart memcached && sudo systemctl restart > koha-common >- Reload http://kohadev.mydnsname.org:8080/api/v1/ >=> SUCCESS: basePath is /api/v1 >- Sign off :-D > >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > Koha/REST/V1.pm | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/Koha/REST/V1.pm b/Koha/REST/V1.pm >index 398a93cc1a..57ad113291 100644 >--- a/Koha/REST/V1.pm >+++ b/Koha/REST/V1.pm >@@ -38,6 +38,11 @@ Overloaded Mojolicious->startup method. It is called at application startup. > sub startup { > my $self = shift; > >+ # Remove /api/v1/app.pl/ from the path >+ $self->hook( before_dispatch => sub { >+ shift->req->url->base->path('/'); >+ }); >+ > # Force charset=utf8 in Content-Type header for JSON responses > $self->types->type(json => 'application/json; charset=utf8'); > >-- >2.14.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20134
:
71239
|
71244
|
71325