The owner of this website has banned your access based on your browsers signature during REST GET request

1
When calling a REST endpoint (GET) from Mendix I get the 'The owner of this website has banned your access based on your browser's signature ' error message. After some research I came accross some possible solutions: "What this site is "checking" is not your browser, it's the "user agent" - a string your client program (browser, Python script or whatever) eventually sends as a request header. You can specify another user agent" Is there any way I can influence the user agent I sent with my request when doing a GET request based on the current REST module? When trying to access this webservice via other methods (Poster/Postman/Just via a browser) no such error occurs, only when trying to call it from Mendix) java.util.concurrent.ExecutionException: com.mendix.modules.microflowengine.MicroflowException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: restservices.consume.RestConsumeException: 403. Rest request failed: [HTTP Request: GET 'http://api.mtgapi.com/v2/sets' --> Response status: 403 Forbidden, ETag: null, body: '<!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>Access denied | api.mtgapi.com used CloudFlare to restrict access</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> <span class="cf-error-type" data-translate="error">Error</span> <span class="cf-error-code">1010</span> <small class="heading-ray-id">Ray ID: 258a36ac6fad0c29 &bull; 2015-12-22 07:46:33 UTC</small> </h1> <h2 class="cf-subheadline" data-translate="error_desc">Access denied</h2> </div><!-- /.header --> <section></section><!-- spacer --> <div class="cf-section cf-wrapper"> <div class="cf-columns two"> <div class="cf-column"> <h2 data-translate="what_happened">What happened?</h2> <p>The owner of this website (api.mtgapi.com) has banned your access based on your browser's signature (258a36ac6fad0c29-ua19).</p> </div>
asked
1 answers
3

The rest module uses a pretty simple Java implementation for performing the get requests. Adding an extra header to set the user agent should be pretty simple.

You should consider making this properly configurable as part of the rest module configuration, and submit a patch to its github page, as your case proves there is a real world need for this to be configurable.

answered