Giphy / GiphyAPI

Public facing API docs, notes and more
1.9k stars 282 forks source link

Public Beta endpoint is returning a CAPTCHA confirmation #99

Closed madcurious closed 8 years ago

madcurious commented 8 years ago

I'm trying out the Giphy API for our app and it worked before the weekend. Now it's throwing a CAPTCHA request at me and I verified that it does that too when done from the browser. This is what I'm getting:

<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>Attention Required! | CloudFlare</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" type="text/css" media="screen,projection" />
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" type="text/css" media="screen,projection" /><![endif]-->
<style type="text/css">body{margin:0;padding:0}</style>
<!--[if lte IE 9]><script type="text/javascript" src="/cdn-cgi/scripts/jquery.min.js"></script><![endif]-->
<!--[if gte IE 10]><!--><script type="text/javascript" src="/cdn-cgi/scripts/zepto.min.js"></script><!--<![endif]-->
<script type="text/javascript" src="/cdn-cgi/scripts/cf.common.js"></script>

</head>
<body>
  <div id="cf-wrapper">
    <div class="cf-alert cf-alert-error cf-cookie-error" id="cookie-alert" data-translate="enable_cookies">Please enable cookies.</div>
    <div id="cf-error-details" class="cf-error-details-wrapper">
      <div class="cf-wrapper cf-header cf-error-overview">
        <h1 data-translate="challenge_headline">One more step</h1>
        <h2 class="cf-subheadline"><span data-translate="complete_sec_check">Please complete the security check to access</span> api.giphy.com</h2>
      </div><!-- /.header -->

      <div class="cf-section cf-highlight cf-captcha-container">
        <div class="cf-wrapper">
          <div class="cf-columns two">
            <div class="cf-column">
              <div class="cf-highlight-inverse cf-form-stacked">
                <form class="challenge-form" id="challenge-form" action="/cdn-cgi/l/chk_captcha" method="get">
  <script type="text/javascript" src="/cdn-cgi/scripts/cf.challenge.js" data-type="normal"  data-ray="2e11e617bc3053ea" async data-sitekey="6LfOYgoTAAAAAInWDVTLSc8Yibqp-c9DaLimzNGM" data-stoken="iFZhPQYO1s0SekpS3JaZ1HQYMmjznAQG_fqV8Z82GDVhTdk-SODAQdicbJ28OmcGnUUCmGW51uC7bmRaM0_Gg5W-HT4KSP3BkeLKcpculVs"></script>
  <div class="g-recaptcha"></div>
  <noscript id="cf-captcha-bookmark" class="cf-captcha-info">
    <div><div style="width: 302px">
      <div>
        <iframe src="https://www.google.com/recaptcha/api/fallback?k=6LfOYgoTAAAAAInWDVTLSc8Yibqp-c9DaLimzNGM&stoken=iFZhPQYO1s0SekpS3JaZ1HQYMmjznAQG_fqV8Z82GDVhTdk-SODAQdicbJ28OmcGnUUCmGW51uC7bmRaM0_Gg5W-HT4KSP3BkeLKcpculVs" frameborder="0" scrolling="no" style="width: 302px; height:422px; border-style: none;"></iframe>
      </div>
      <div style="width: 300px; border-style: none; bottom: 12px; left: 25px; margin: 0px; padding: 0px; right: 25px; background: #f9f9f9; border: 1px solid #c1c1c1; border-radius: 3px;">
        <textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 40px; border: 1px solid #c1c1c1; margin: 10px 25px; padding: 0px; resize: none;"></textarea>
        <input type="submit" value="Submit"></input>
      </div>
    </div></div>
  </noscript>
</form>

              </div>
            </div>

            <div class="cf-column">
              <div class="cf-screenshot-container">

                <span class="cf-no-screenshot"></span>

              </div>
            </div>
          </div><!-- /.columns -->
        </div>
      </div><!-- /.captcha-container -->

      <div class="cf-section cf-wrapper">
        <div class="cf-columns two">
          <div class="cf-column">
            <h2 data-translate="why_captcha_headline">Why do I have to complete a CAPTCHA?</h2>

            <p data-translate="why_captcha_detail">Completing the CAPTCHA proves you are a human and gives you temporary access to the web property.</p>
          </div>

          <div class="cf-column">
            <h2 data-translate="resolve_captcha_headline">What can I do to prevent this in the future?</h2>

            <p data-translate="resolve_captcha_antivirus">If you are on a personal connection, like at home, you can run an anti-virus scan on your device to make sure it is not infected with malware.</p>

            <p data-translate="resolve_captcha_network">If you are at an office or shared network, you can ask the network administrator to run a scan across the network looking for misconfigured or infected devices.</p>
          </div>
        </div>
      </div><!-- /.section -->

      <div class="cf-error-footer cf-wrapper">
  <p>
    <span class="cf-footer-item">CloudFlare Ray ID: <strong>2e11e617bc3053ea</strong></span>
    <span class="cf-footer-separator">&bull;</span>
    <span class="cf-footer-item"><span data-translate="your_ip">Your IP</span>: XXX.XX.XX.XXX</span>
    <span class="cf-footer-separator">&bull;</span>
    <span class="cf-footer-item"><span data-translate="performance_security_by">Performance &amp; security by</span> <a data-orig-proto="https" data-orig-ref="www.cloudflare.com/5xx-error-landing?utm_source=error_footer" id="brand_link" target="_blank">CloudFlare</a></span>

  </p>
</div><!-- /.error-footer -->

    </div><!-- /#cf-error-details -->
  </div><!-- /#cf-wrapper -->

  <script type="text/javascript">
  window._cf_translation = {};

</script>

</body>
</html>

I've already enabled cookies on the code side just to be sure:

static let session: NSURLSession = {
    let configuration = NSURLSessionConfiguration.defaultSessionConfiguration()
    configuration.timeoutIntervalForRequest = 15
    configuration.HTTPCookieAcceptPolicy = .Always

    let session = NSURLSession(configuration: configuration)
    return session
}()
StewPoll commented 8 years ago

Sounds like cloudflare is preventing ddos attacks by ensuring requests are made by a human.

Not sure why an api is behind cloudflare.

On Mon, 12 Sep 2016, 6:20 PM Matt Quiros notifications@github.com wrote:

I'm trying out the Giphy API for our app and it worked before the weekend. Now it's throwing a CAPTCHA request at me and I verified that it does that too when done from the browser. This is what I'm getting:


<!--[if gt IE 8]><!--> <!--<![endif]-->

Attention Required! | CloudFlare

body{margin:0;padding:0}

<!--[if gte IE 10]><!--><!--<![endif]-->

Please enable cookies.

One more step
Please complete the security check to access api.giphy.com

<!-- /.header -->

  <div class="cf-section cf-highlight cf-captcha-container">
    <div class="cf-wrapper">
      <div class="cf-columns two">
        <div class="cf-column">
          <div class="cf-highlight-inverse cf-form-stacked">
            <form class="challenge-form" id="challenge-form" action="/cdn-cgi/l/chk_captcha" method="get">
  </div>
</div>

<div class="cf-column">
  <div class="cf-screenshot-container">

    <span class="cf-no-screenshot"></span>

  </div>
</div>


  </div><!-- /.captcha-container -->

  <div class="cf-section cf-wrapper">
    <div class="cf-columns two">
      <div class="cf-column">
        <h2 data-translate="why_captcha_headline">Why do I have to complete a CAPTCHA?</h2>
<p data-translate="why_captcha_detail">Completing the CAPTCHA proves you are a human and gives you temporary access to the web property.</p>

What can I do to prevent this in the future?

If you are on a personal connection, like at home, you can run an anti-virus scan on your device to make sure it is not infected with malware.

If you are at an office or shared network, you can ask the network administrator to run a scan across the network looking for misconfigured or infected devices.



  </div><!-- /.section -->

  <div class="cf-error-footer cf-wrapper">

CloudFlare Ray ID: _2e11e617bc3053ea_
•
Your IP: XXX.XX.XX.XXX
•
Performance & security by CloudFlare

<!-- /.error-footer -->

</div><!-- /#cf-error-details -->

<!-- /#cf-wrapper -->

I've already enabled cookies on the code side just to be sure:

static let session: NSURLSession = {
let configuration = NSURLSessionConfiguration.defaultSessionConfiguration()
configuration.timeoutIntervalForRequest = 15
configuration.HTTPCookieAcceptPolicy = .Always

let session = NSURLSession(configuration: configuration)
return session

}()

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/Giphy/GiphyAPI/issues/99, or mute the thread
https://github.com/notifications/unsubscribe-auth/AGk_7fip6uMKtxD3wjYak2TiFwD0MjcNks5qpQtBgaJpZM4J6VsJ
.
madcurious commented 8 years ago

As of this comment time, the API is working again without the CAPTCHA request.

timfrietas commented 8 years ago

This should be resolved. Sorry for the inconvenience!