OAI identify command base URL does not respect HTTPS; appends index.php unnecessarily
|Target version:||Release 2.6.0|
|Google Code Legacy ID:||Tested version:||2.5, 2.6|
First reported in the AtoM user forum, 2019-08-26: https://groups.google.com/d/msg/ica-atom-users/Pyj4DppbaGg/YW-HWs_lAwAJ
Currently, regardless of what the user inputs in the Base URL setting field, or whether or not they have HTTPS enabled on their site, the OAI repository's "Identify" response will always use "http://" as part of the base URL value returned - and it will also append /index.php, though this is not necessary for most sites.
- Enable the OAI plugin, and configure the settings
- In Admin > Settings > Site information, add https://www.example.com as the base url, and save
- Enter the URL for the Identify command:
[test site URL]/;oai?verb=Identify
- Base URL value in the Identify response is returned as:
- https is replaced with http
- /index.php is unnecessarily appended to the URL
- The base URL value appears as a user enters it
- https is respected in the baseURL value included in the OAI Identify response
- /index.php is not appended to the URL if not needed
#1 Updated by Dan Gillean 9 months ago
As far as I can tell, the issue resides in the code here:
I'm not a developer, but from what I can understand of this, the getBaseUrl() function uses the function described above it, parseUrlHost, on line 183. However, if you look up at the parseUrlHost function, it appears that appending http:// is hardcoded as part of the function! I'm not entirely sure, but I suspect this is where the problem lies.
I can't personally figure out where the /index.php is being appended, but this too should not be done unnecessarily.
#3 Updated by Mike Cantelon 9 months ago
- Status changed from In progress to Code Review
- Assignee deleted (
There was logic trying to figure out where the request was using HTTP or HTTPS and overriding the site's base URL in the OAI result. Simplified it to also use the base URL unaltered. This also fixes the issue with
/index.php being appended.
PR for CR: https://github.com/artefactual/atom/pull/965