Bugzilla – Attachment 132599 Details for
Bug 30394
Add 'draw' handling to the datatables wrapper and REST API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30394: Add x-koha-request-id handling in controllers
Bug-30394-Add-x-koha-request-id-handling-in-contro.patch (text/plain), 1.95 KB, created by
Martin Renvoize (ashimema)
on 2022-03-30 12:41:21 UTC
(
hide
)
Description:
Bug 30394: Add x-koha-request-id handling in controllers
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-03-30 12:41:21 UTC
Size:
1.95 KB
patch
obsolete
>From e0bd8320021b5eff6ea43ffc76375982e4b47cad Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 30 Mar 2022 13:45:48 +0200 >Subject: [PATCH] Bug 30394: Add x-koha-request-id handling in controllers > >This patch adds 'x-koha-request-id' to the reserved param names list, >and makes the objects.search helper read it and send it back in the >response headers. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/REST/Plugin/Objects.pm | 4 ++++ > Koha/REST/Plugin/Query.pm | 2 +- > 2 files changed, 5 insertions(+), 1 deletion(-) > >diff --git a/Koha/REST/Plugin/Objects.pm b/Koha/REST/Plugin/Objects.pm >index 86c1d297e0..4a5d29143c 100644 >--- a/Koha/REST/Plugin/Objects.pm >+++ b/Koha/REST/Plugin/Objects.pm >@@ -182,6 +182,10 @@ shouldn't be called twice in it. > $filtered_params = $c->merge_q_params( $filtered_params, $query_params, $result_set ); > } > >+ # request sequence id (i.e. 'draw' Datatables parameter) >+ $c->res->headers->add( 'x-koha-request-id' => $reserved_params->{'x-koha-request-id'} ) >+ if $reserved_params->{'x-koha-request-id'}; >+ > # If search_limited exists, use it > $result_set = $result_set->search_limited, > if $result_set->can('search_limited'); >diff --git a/Koha/REST/Plugin/Query.pm b/Koha/REST/Plugin/Query.pm >index 5603e60294..5875d92a46 100644 >--- a/Koha/REST/Plugin/Query.pm >+++ b/Koha/REST/Plugin/Query.pm >@@ -310,7 +310,7 @@ reference: https://metacpan.org/changes/distribution/JSON-Validator#L14 > > sub _reserved_words { > >- my @reserved_words = qw( _match _order_by _order_by[] _page _per_page q query x-koha-query); >+ my @reserved_words = qw( _match _order_by _order_by[] _page _per_page q query x-koha-query x-koha-request-id ); > return \@reserved_words; > } > >-- >2.20.1
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 30394
:
132576
|
132577
|
132578
|
132579
|
132582
|
132583
|
132584
|
132585
|
132598
| 132599 |
132600
|
132601
|
132602