[Koha-bugs] [Bug 31104] Pagination generates HTTP "Link:" header which is over 8192 bytes apache's limit

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Jul 11 16:31:37 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31104

Martin Renvoize <martin.renvoize at ptfs-europe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #137433|0                           |1
        is obsolete|                            |

--- Comment #5 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Created attachment 137517
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137517&action=edit
Bug 31104: Put each link on a separate header

This patch makes the Pagination helper put each Link entry on the
response headers on a separate header. In practice, this leads to
shorter headers and will avoid apache default/reasonable limits.

To test:
1. Open the patron search page
2. Open the koha logs:
   $ tail -f /var/log/koha/kohadev/*.log
3. On the 'Search for patron' input, use a really long string, like
   'superlongstringthatistoolongforapacheyeahsuperlong'
=> SUCCESS: There's no user with an attribute with that content :-D
=> FAIL: You get an error like (28)No space left on device: [client
127.0.0.1:60330] AH10124: header size is over the limit allowed by
ResponseFieldSize (8192 bytes). Bad response header: 'Link:...'
4. Apply this patch
5. Restart all:
   $ restart_all
6. Repeat 2 and 3
=> SUCCESS: No results
=> SUCCESS: No error in the logs
7. Run:
   $ kshell
  k$ prove t/Koha/REST/Plugin/Pagination.t \
           t/db_dependent/api/v1/*.t
=> SUCCESS: Tests pass!

Note 1: The Link header is expected to be in CSV format, which is
usually the way libraries treat repeated headers anyway.

Note 2: Apache is not rejecting the response, just stripping out the
'bad header'. So this is not a critical issue.

Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Michal Urban <michalurban177 at gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list