correct link test if HTTP response is kind of Success or Redirection #1927

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@keram
Contributor
keram commented Sep 5, 2012

I swear it worked before! Until someone send my bugreport... .)

Explanation:
If url is valid Net::HTTP.get_response(url) returns Net::HTTPOK class which is kind of Net::HTTPSuccess but fails in test [Net::HTTPSuccess].include..

In generally I thinking about refactoring all this method, because:

  • On localhost I have problem test other url than on port 80.
  • https links (not tested)
  • intranet links, other networks etc may been also problem and user can be confused with failing validation.

Couldn't be better put here only simple regexp?

Owner
parndt commented Sep 5, 2012

Yeah but a simple regexp doesn't say whether the page exists or not.

Maybe the feature itself is just something to get rid of? @ugisozols @robyurkowski

Contributor
keram commented Sep 5, 2012

or change it to client side validation and check url through ajax call?

Owner
parndt commented Sep 5, 2012

Yes client side would work 👍

Are you keen to work on it?

Owner

I would get rid of this feature because I prefer manual check of the url - it gives me more confidence that the url I'm linking to is working as expected.

@parndt parndt added a commit that referenced this pull request Sep 6, 2012
@keram @parndt keram + parndt Improved client side link validation with ajax page test
Fixes #1929 and #1927
581204a
Owner
parndt commented Sep 6, 2012

Fixed by #1929

@parndt parndt closed this Sep 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment