[Koha-bugs] [Bug 24384] Add Access-Control-Allow-Origin support to OPAC reports svc

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Mar 16 12:09:44 CET 2020


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

Nick Clemens <nick at bywatersolutions.com> changed:

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

--- Comment #3 from Nick Clemens <nick at bywatersolutions.com> ---
Created attachment 100732
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100732&action=edit
Bug 24384: Add Access-Control-Allow-Origin support to OPAC reports svc

This patch makes the opac/svc/report script use output_with_http_headers
so it sets the Access-Control-Allow-Origin header.

To test:
1. Create a new public report and remember the report id
2. Use your favourite too to fetch the report in JSON by issuing:
   GET http://localhost:8080/cgi-bin/koha/svc/report?id=1
=> FAIL: There is no Access-Control-Allow-Origin header
3. Apply this patch
4. Restart Plack
   $ sudo koha-plack --restart kohadev
5. Set the AccessControlAllowOrigin to anything (for example,
   https://koha-community.org)
6. Repeat 2
=> SUCCESS: On the response headers you find
Access-Control-Allow-Origin: https://koha-community.org
7. Sign off :-D

Signed-off-by: David Nind <david at davidnind.com>

Signed-off-by: Nick Clemens <nick at bywatersolutions.com>

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


More information about the Koha-bugs mailing list