Summary: | Add Access-Control-Allow-Origin support to OPAC reports svc | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | Web services | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | 1joynelson, kyle, martin.renvoize, nick |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
Using the foundations laid with bug 24369 this enhancement allows the CORS headers to be set on the OPAC Reports SVC routes.
|
Version(s) released in: |
20.05.00
|
Circulation function: | |||
Bug Depends on: | 24369 | ||
Bug Blocks: | |||
Attachments: |
Bug 24384: Add Access-Control-Allow-Origin support to OPAC reports svc
Bug 24384: Add Access-Control-Allow-Origin support to OPAC reports svc Bug 24384: Add Access-Control-Allow-Origin support to OPAC reports svc |
Description
Tomás Cohen Arazi (tcohen)
2020-01-09 14:27:30 UTC
Created attachment 97095 [details] [review] 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 Created attachment 100705 [details] [review] 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@davidnind.com> Created attachment 100732 [details] [review] 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@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Nice work everyone! Pushed to master for 20.05 not backported to 19.11.x due to dependencies |