title: cors-anywhere trying to parse html as json
body: <p>I had a cors issue that I posted last week. You can read about it
  here:</p>
  
  <p><a href="https://stackoverflow.com/questions/55539484/how-to-solve-cors-error-when-requesting-access-token-from-google-oauth2-provider">How to solve cors error when requesting access token from google oauth2 provider</a></p>
  
  <p>I read sideshowbarker’s in-depth explanation of how to avoid cors issues here:</p>
  
  <p><a href="https://stackoverflow.com/questions/43871637/no-access-control-allow-origin-header-is-present-on-the-requested-resource-whe/43881141#43881141">No &#39;Access-Control-Allow-Origin&#39; header is present on the requested resource—when trying to get data from a REST API</a></p>
  
  <p>One of the suggestions he makes in this posts is to use a proxy server:</p>
  
  <pre><code>const proxyurl = "https://cors-anywhere.herokuapp.com/";
  const url = "https://example.com"; // site that doesn’t send Access-Control-*
  fetch(proxyurl + url) // https://cors-anywhere.herokuapp.com/https://example.com
  .then(response =&gt; response.text())
  .then(contents =&gt; console.log(contents))
  .catch(() =&gt; console.log("Can’t access " + url + " response. Blocked by browser?"))
  </code></pre>
  
  <p>Essentially, the idea is to send your request through cors-anywhere.herokuapp.com, which will attach the cors headers on the response as it comes back.</p>
  
  <p>This worked like a charm as I am no longer getting cors errors.</p>
  
  <p>However, I am now getting this error:</p>
  
  <blockquote>
    <p>SyntaxError: Unexpected token &lt; in JSON at position 0 at JSON.parse…</p>
  </blockquote>
  
  <p>And the error text I’m getting is:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head lang=en&gt;
    &lt;title&gt;AniList&lt;/title&gt;
    &lt;meta charset=utf-8&gt;
    &lt;meta http-equiv=x-ua-compatible content="ie=edge"&gt;
    &lt;meta http-equiv=Content-Security-Policy content=block-all-mixed-content&gt;
    &lt;meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"&gt;
    &lt;meta property=og:site_name content=AniList&gt;
    &lt;meta name=twitter:site content=@AniChartNet&gt;
    &lt;meta name=twitter:card content=summary&gt;
    &lt;script&gt;window.al_token = 'r0ePKxAFyZlUis7rLbkHzsRfeHnX1y3fOyVNBAhv';&lt;/script&gt;
    &lt;link href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel=stylesheet&gt;
    &lt;link rel=icon type=image/png sizes=32x32 href=/img/icons/favicon-32x32.png&gt;
    &lt;link rel=icon type=image/png sizes=16x16 href=/img/icons/favicon-16x16.png&gt;
    &lt;link rel=manifest href=/manifest.json&gt;
    &lt;meta name=theme-color content=#1f2631&gt;
    &lt;meta name=apple-mobile-web-app-capable content=yes&gt;
    &lt;meta name=apple-mobile-web-app-status-bar-style content=black&gt;
    &lt;meta name=apple-mobile-web-app-title content=AniList&gt;
    &lt;link rel=apple-touch-icon href=/img/icons/apple-touch-icon-152x152.png&gt;
    &lt;link rel=mask-icon href=/img/icons/safari-pinned-tab.svg color=#1f2631&gt;
    &lt;meta name=msapplication-TileImage content=/img/icons/msapplication-icon-144x144.png&gt;
    &lt;meta name=msapplication-TileColor content=#1f2631&gt;
    &lt;script src="https://www.google.com/recaptcha/api.js?onload=vueRecaptchaApiLoaded&amp;render=explicit" async defer&gt;&lt;/script&gt;
    &lt;link href=/css/chunk-vendors.3826fb1f.css rel=preload as=style&gt;
    &lt;link href=/css/main.814d29e0.css rel=preload as=style&gt;
    &lt;link href=/js/chunk-vendors.6babed9d.js rel=modulepreload as=script&gt;
    &lt;link href=/js/main.354f3a88.js rel=modulepreload as=script&gt;
    &lt;link href=/css/chunk-vendors.3826fb1f.css rel=stylesheet&gt;
    &lt;link href=/css/main.814d29e0.css rel=stylesheet&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;noscript&gt;
       &lt;div class=noscript&gt;Sorry, AniList requires Javascript.&lt;br&gt;Please enable Javascript or &lt;a href=http://outdatedbrowser.com&gt;upgrade to a modern web browser&lt;/a&gt;.&lt;/div&gt;
    &lt;/noscript&gt;
    &lt;div class="noscript modern-browser" style="display: none"&gt;Sorry, AniList requires a modern browser.&lt;br&gt;Please &lt;a href=http://outdatedbrowser.com&gt;upgrade to a newer web browser&lt;/a&gt;.&lt;/div&gt;
    &lt;div id=app&gt;&lt;/div&gt;
    &lt;script type=module src=/js/chunk-vendors.6babed9d.js&gt;&lt;/script&gt; . 
  &lt;script type=module src=/js/main.354f3a88.js&gt;&lt;/script&gt; . 
  &lt;script&gt;!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&amp;&amp;"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();&lt;/script&gt;&lt;script src=/js/chunk-vendors-legacy.e7161f54.js nomodule&gt;&lt;/script&gt;&lt;script src=/js/main-legacy.5b341a0e.js nomodule&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>So it seems like cors-anywhere is trying to parse the above html as json but obviously can’t. I believe the html is the sign in page I’m expecting back from anilist (but it’s hard to tell unless I can view it in a browser which I’m not able to).</p>
  
  <p>So my question is: is there a way to tell cors-anywhere not to try to parse the response as json but to simply send it back as-is?</p>
  
  <p>Thanks</p>