Bugzilla – Attachment 94584 Details for
Bug 23860
Patrons endpoint not setting the Location header
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23860: Make the patrons endpoint add the Location header
Bug-23860-Make-the-patrons-endpoint-add-the-Locati.patch (text/plain), 1003 bytes, created by
Tomás Cohen Arazi (tcohen)
on 2019-10-22 16:57:54 UTC
(
hide
)
Description:
Bug 23860: Make the patrons endpoint add the Location header
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-10-22 16:57:54 UTC
Size:
1003 bytes
patch
obsolete
>From e6952f71876cdee43dc8e977b42b3c1951e79b78 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 21 Oct 2019 16:21:16 -0300 >Subject: [PATCH] Bug 23860: Make the patrons endpoint add the Location header > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/REST/V1/Patrons.pm | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/Koha/REST/V1/Patrons.pm b/Koha/REST/V1/Patrons.pm >index 46ad80d01d..fb9e51f67a 100644 >--- a/Koha/REST/V1/Patrons.pm >+++ b/Koha/REST/V1/Patrons.pm >@@ -127,7 +127,11 @@ sub add { > > my $patron = Koha::Patron->new( _to_model($body) )->store; > >- return $c->render( status => 201, openapi => $patron->to_api ); >+ $c->res->headers->location( $c->req->url->to_string . '/' . $patron->borrowernumber ); >+ return $c->render( >+ status => 201, >+ openapi => $patron->to_api >+ ); > } > catch { > unless ( blessed $_ && $_->can('rethrow') ) { >-- >2.23.0
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 23860
:
94583
|
94584
|
94585
|
94941
|
94942
|
94943