htmlpreview / htmlpreview.github.com

HTML Preview for GitHub Repositories
htmlpreview.github.com
1.51k stars 303 forks source link

Try fetching without proxy first #96

Closed TrianguloY closed 3 years ago

TrianguloY commented 3 years ago

When fetching a resource, try directly first. If it throws an error, then try with proxies. Fixes #95 Should also reduce drastically the petitions to the proxy servers (will only be made if the non-proxy fails)

[Note: I tested it with some urls, but probably more tests are needed before merge]

Edit: test links: https://trianguloy.github.io/htmlpreview.github.com/?https://www.dropbox.com/s/mgw65rktedx4pjl/Hello%32world.html?raw=1 https://trianguloy.github.io/htmlpreview.github.com/?https://github.com/twbs/bootstrap/gh-pages/2.3.2/index.html https://trianguloy.github.io/htmlpreview.github.com/?https://github.com/documentcloud/backbone/blob/master/examples/todos/index.html

FranklinYu commented 3 years ago

I think we can also remove https://yacdn.org/proxy/, which no longer works?