-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review expensive HTTP operation in archive.html #1187
Comments
Hi @segun-codes, I think you can also try an async function. |
Okay, thanks @liliyao2022. @jywarren, @TildaDares still awaiting your comments on this issue. Thank you. |
Hi @segun-codes, can you tell us a bit more about how you plan to validate the url? Do you plan to use regex? Thank you! |
Hi @TildaDares,
What do you think? Your ideas are most welcome too @TildaDares @jywarren. Many thanks. |
Hi @TildaDares, I will proceed to fix and open a PR for this issue, many thanks. |
The code snippet below is extracted from
/examples/archive.html
, I am of the opinion thataxios.get(...)
shouldn't be invoked without validating that the user-suppliedurl
argument meets certain criteria before attempting to perform the expensive over-the-networkget
operation albeit there's a failure handling mechanism in place.I could improve the code by validating the url first, then wrap
axios.get(...)
codes in anif
statement. For instance, if the url must always originate fromhttps://archive.org
, then the proposed validation will ensure this. Where validation fails, a small notification message is displayed to the user with thewelcomeModal
still in view.@jywaren, what do you think? Can I give this a shot? Many thanks.
The text was updated successfully, but these errors were encountered: