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');