Settings: validate public gateway before saving it #1844
Labels
area/screen/settings
Issues related to Settings screen
exp/intermediate
Prior experience is likely helpful
help wanted
Seeking public contribution on this issue
P2
Medium: Good to have, but can wait until someone steps up
Current state
#1834 introduced ability to customize public gateway used for shareable URLs and download via preview screen.
The only validation we do is making sure the entered string is a valid URL.
Proposed improvement
We should validate that the gateway is functional before storing it in
localStorage
to avoid users breaking their experience by entering an invalid gateway address (typo, server being down, etc).Note on how to validate
Some gateways may not allow cross-origin requests (CORS), so we can't test them using regular
fetch
.Workaround: use Image load instead.
<img>
tags are not being validated using CORS rules.Prior art is
checkViaImgSrc
– can be found here.The text was updated successfully, but these errors were encountered: