Bugzilla – Attachment 94481 Details for
Bug 23858
Vendors endpoint not setting the Location header
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23858: Make POST add the Location header on vendors endpoint
Bug-23858-Make-POST-add-the-Location-header-on-ven.patch (text/plain), 1.14 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-10-21 17:25:29 UTC
(
hide
)
Description:
Bug 23858: Make POST add the Location header on vendors endpoint
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-10-21 17:25:29 UTC
Size:
1.14 KB
patch
obsolete
>From cf009e740322ed81ce0d10ec5380a46015ca969b Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 21 Oct 2019 14:23:15 -0300 >Subject: [PATCH] Bug 23858: Make POST add the Location header on vendors > endpoint > >According to the coding guidelines, this endpoint should be adding the >Location header on POST actions. > >To test: >1. Apply the tests patch >2. Run: > $ kshell > k$ prove t/db_dependent/api/v1/acquisition_vendors.t >=> FAIL: Tests fail! >3. Apply this patch >4. Repeat (1) >=> SUCCESS: Tests pass! >5. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/REST/V1/Acquisitions/Vendors.pm | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/Koha/REST/V1/Acquisitions/Vendors.pm b/Koha/REST/V1/Acquisitions/Vendors.pm >index f5686b0ded..a051c2e7ee 100644 >--- a/Koha/REST/V1/Acquisitions/Vendors.pm >+++ b/Koha/REST/V1/Acquisitions/Vendors.pm >@@ -101,6 +101,7 @@ sub add_vendor { > > return try { > $vendor->store; >+ $c->res->headers->location($c->req->url->to_string . '/' . $vendor->id ); > return $c->render( > status => 200, > openapi => $vendor->to_api >-- >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 23858
:
94480
|
94481
|
94482
|
94534
|
94535
|
94536
|
94796
|
94797
|
94798