Rotonde / beaker

Rotonde client with user account combined(deprecated)
MIT License
205 stars 37 forks source link

fixed a regex that was creating malformed URLs #52

Closed aeonofdiscord closed 7 years ago

aeonofdiscord commented 7 years ago

This message: What about encoding our portal.json with msgpack5? (https://www.npmjs.com/package/msgpack5) [...] was causing rotonde to try to parse the brackets as part of the URL, which failed and threw an exception, preventing the feed from rendering.

This PR adds a tiny regex fix to prevent that from happening by ignoring URLs that don't start with http(s)://

cblgh commented 7 years ago

thanks for the fix @aeonofdiscord! i think i'll have to replace the regex with something more robust, as we'll have similar problems if someone typoes an url and adds junk to the end

to your patch i added a commit that wraps the process in a try-catch to prevent the feed from crashing entirely if someone e.g. pastes a bad url, or typos at the end.