Describe the bug
When you load the "classic" php pages that don't use "pretty" urls, the modified url for the images with a relative src is incorrect.
To Reproduce
Steps to reproduce the behavior:
Go to a site that ends with a page + extension, like index.html or index.php that uses relative url for an image.
Image a11y will now use the following fetch url https://image-recognition-function.azurewebsites.net/api/AnalyseImage?url=http://www.site.com/index.php/images/image.jpg
See the following error from the API:
{"code":"InvalidImageUrl","requestId":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx","message":"Image URL is not accessible."}
Expected behavior
Image a11y should use the following url https://image-recognition-function.azurewebsites.net/api/AnalyseImage?url=http://www.site.com/images/image.jpg to request description from API.
Desktop (please complete the following information):
Browser Chrome
Version 81
Additional context
i think a regex test against window.location.pathname, while determining the src variable in src/add-alt-attributes.js could be a way to resolve this
Describe the bug When you load the "classic" php pages that don't use "pretty" urls, the modified url for the images with a relative src is incorrect.
To Reproduce Steps to reproduce the behavior:
index.html
orindex.php
that uses relative url for an image.https://image-recognition-function.azurewebsites.net/api/AnalyseImage?url=http://www.site.com/index.php/images/image.jpg
Expected behavior Image a11y should use the following url
https://image-recognition-function.azurewebsites.net/api/AnalyseImage?url=http://www.site.com/images/image.jpg
to request description from API.Desktop (please complete the following information):
Additional context i think a regex test against
window.location.pathname
, while determining thesrc
variable in src/add-alt-attributes.js could be a way to resolve this