Closed juhoinkinen closed 7 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.65%. Comparing base (
1e182b2
) to head (a81b01a
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Issues
0 New issues
Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
Displaying the version of Annif on Web UI was added in PR #745, but it was not working when Annif was deployed on a site using https, e.g. https://dev.annif.org: Firefox console showed error
and the displayed version string was empty.
~This SO answer advises to add a metatag for "Content-Security-Policy: upgrade-insecure-requests". This "is intended for websites with large numbers of insecure legacy URLs that need to be rewritten", but I did not find another way to fix this, because the version number is queried from
/v1
path, whatever the site domain is.~But now I started to wonder why the same error does not arise when querying projects from
/v1/projects
path, which is also a GET request...Edit: Force pushed with a more proper way to fix this by fetching the version information from url
/v1/
(with trailing slash), which was hinted in some SO answers. It seemed that directly accessing https://dev.annif.org/v1 with a browser was returned with a 308 Permanent Redirect to https://dev.annif.org/v1/, so it seems the trailing slash "just makes this work", and this is related to the (root) path defined in the OpenAPI spec used for the version, which appends a slash to/v1
.