Summary: | Remove /api/v1/app.pl from the generated URLs | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | REST API | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | josef.moravec, julian.maurice, nick, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 20134: Remove /api/v1/app.pl from the generated URLs
Bug 20134: Remove /api/v1/app.pl from the generated URLs Bug 20134: Remove /api/v1/app.pl from the generated URLs |
Description
Tomás Cohen Arazi (tcohen)
2018-02-05 13:25:11 UTC
Created attachment 71239 [details] [review] Bug 20134: Remove /api/v1/app.pl from the generated URLs This patch removes the /api/v1/app.pl prefix from generated baseUrl. It has the consequence of hardcoding / as the base path for the API. This is ok because we don't currently support mounting Koha pieces in different than hardcoded paths (/cgi-bin/koha?), but certainly worth mentioning because this will need to depend on a syspref or config entry when someone chages this behviour. To test: - On master, point your browser to: http://kohadev.mydnsname.org:8080/api/v1/ => FAIL: basePath looks like /api/v1/app.pl/api/v1 - Apply this patch - Restart memcached and plack: $ restart_all or $ sudo systemctl restart memcached && sudo systemctl restart koha-common - Reload http://kohadev.mydnsname.org:8080/api/v1/ => SUCCESS: basePath is /api/v1 - Sign off :-D I just discovered that I can go to http://kohadev.mydnsname.org:8080/api/v1.html to have the API spec in a readable format, which is nice :) And also that it doesn't work in CGI mode (http://kohadev.mydnsname.org/api/v1/.json works curiously, but not the html version ; etc/koha-httpd.conf probably needs some changes) Anyway, the patch works, so, sign-off coming soon ;) Created attachment 71244 [details] [review] Bug 20134: Remove /api/v1/app.pl from the generated URLs This patch removes the /api/v1/app.pl prefix from generated baseUrl. It has the consequence of hardcoding / as the base path for the API. This is ok because we don't currently support mounting Koha pieces in different than hardcoded paths (/cgi-bin/koha?), but certainly worth mentioning because this will need to depend on a syspref or config entry when someone chages this behviour. To test: - On master, point your browser to: http://kohadev.mydnsname.org:8080/api/v1/ => FAIL: basePath looks like /api/v1/app.pl/api/v1 - Apply this patch - Restart memcached and plack: $ restart_all or $ sudo systemctl restart memcached && sudo systemctl restart koha-common - Reload http://kohadev.mydnsname.org:8080/api/v1/ => SUCCESS: basePath is /api/v1 - Sign off :-D Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> I get a not found trying to access: http://localhost:8080/api/v1 Am I missing something? (In reply to Katrin Fischer from comment #4) > I get a not found trying to access: > http://localhost:8080/api/v1 > > Am I missing something? Working for me: http://localhost:8080/api/v1/ Josef, feel free to pass QA then - I think my devbox might just be a bit outdated. (In reply to Katrin Fischer from comment #4) > I get a not found trying to access: > http://localhost:8080/api/v1 > > Am I missing something? Yes, the trailing slash. Hah! Will try again in the evening. ... and it sure was the trailing slash! Created attachment 71325 [details] [review] Bug 20134: Remove /api/v1/app.pl from the generated URLs This patch removes the /api/v1/app.pl prefix from generated baseUrl. It has the consequence of hardcoding / as the base path for the API. This is ok because we don't currently support mounting Koha pieces in different than hardcoded paths (/cgi-bin/koha?), but certainly worth mentioning because this will need to depend on a syspref or config entry when someone chages this behviour. To test: - On master, point your browser to: http://kohadev.mydnsname.org:8080/api/v1/ => FAIL: basePath looks like /api/v1/app.pl/api/v1 - Apply this patch - Restart memcached and plack: $ restart_all or $ sudo systemctl restart memcached && sudo systemctl restart koha-common - Reload http://kohadev.mydnsname.org:8080/api/v1/ => SUCCESS: basePath is /api/v1 - Sign off :-D Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Pushed to master for 18.05, thanks to everybody involved! Awesome work all, pushed to stable for 17.11.03 |