rss-bridge icon indicating copy to clipboard operation
rss-bridge copied to clipboard

Validate URL

Open yamanq opened this issue 3 years ago • 7 comments

Describe the bug Several bridges have a url input field. When a user inputs invalid contents (e.g. #2728 Context 3), this results in an error.

To Reproduce Steps to reproduce the behavior:

  1. Enter ://www.mydealz.de/diskussion/title-123 into the third context of MydealsBridge

Expected behavior Observe well-formatted returnServerError. In addition to handling the exceptions, bridges like MydealsBridge should validate inputs (e.g. XenForoBridge).

Observed behavior image

  • Using latest master: bb6d553d

Additional context This problem still existed before #2692, though the Exception had a more complete message:

Could not get contents
cURL error:  (3)

yamanq avatar May 13 '22 13:05 yamanq

This particular problem with mydealsbridge is because there is an exception in the exception handling. I'm observing Protocol "" not supported or disabled in libcurl (1).

This issue touches on a lot of things at the same time. Since we don't have a url type for bridge forms, we must manually validate the input in each bridge.

dvikan avatar Jun 04 '22 23:06 dvikan

Yes, I guess there are 2 issues here:

  • Feature Request: url type for bridge parameters that validates the input
  • Bug: Exceptions should show returnServerError dialog

yamanq avatar Jun 05 '22 17:06 yamanq

We have a low amount of url inputs so I suggest we don't introduce a new type. Manual validation in each bridge is fine.

What exactly is a returnServerError dialog? I think you mean better UX? Or maybe you mean that this error too shows up as an item in a feed?

dvikan avatar Jun 05 '22 17:06 dvikan

A quick search shows about 20 bridges use url. I think we have url validation somewhere in core anyways so why would you be against making that available to bridges?

Yes, just better UX

yamanq avatar Jun 05 '22 18:06 yamanq

It's a tradeoff. I prefer less code and simpler code. Not much value to be gained. I also think it takes an hour to implement correctly. Feel free to make a PR.

dvikan avatar Jun 05 '22 18:06 dvikan

Wouldn't this equate to more code as each bridge implements the same validation?

yamanq avatar Jun 05 '22 19:06 yamanq

Less code in the core.

dvikan avatar Jun 05 '22 19:06 dvikan