original_string: protected function detectReturnType()
      {
          if (isset($_GET['cookie'])) {
              $this->returnType = 'none';
              return;
          } elseif (!empty($_GET['return_url'])) {
              $this->returnType = 'redirect';
          } elseif (!empty($_GET['callback'])) {
              $this->returnType = 'jsonp';
          } elseif (strpos($_SERVER['HTTP_ACCEPT'], 'image/') !== false) {
              $this->returnType = 'image';
          } elseif (strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false) {
              $this->returnType = 'json';
          }
      }
code: protected function detectReturnType()
      {
          if (isset($_GET['cookie'])) {
              $this->returnType = 'none';
              return;
          } elseif (!empty($_GET['return_url'])) {
              $this->returnType = 'redirect';
          } elseif (!empty($_GET['callback'])) {
              $this->returnType = 'jsonp';
          } elseif (strpos($_SERVER['HTTP_ACCEPT'], 'image/') !== false) {
              $this->returnType = 'image';
          } elseif (strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false) {
              $this->returnType = 'json';
          }
      }
code_tokens: protected function detectReturnType ( ) { if ( isset ( $ _GET [ 'cookie' ] ) ) { $ this -> returnType = 'none' ; return ; } elseif ( ! empty ( $ _GET [ 'return_url' ] ) ) { $ this -> returnType = 'redirect' ; } elseif ( ! empty ( $ _GET [ 'callback' ] ) ) { $ this -> returnType = 'jsonp' ; } elseif ( strpos ( $ _SERVER [ 'HTTP_ACCEPT' ] , 'image/' ) !== false ) { $ this -> returnType = 'image' ; } elseif ( strpos ( $ _SERVER [ 'HTTP_ACCEPT' ] , 'application/json' ) !== false ) { $ this -> returnType = 'json' ; } }
docstring: Detect the type for the HTTP response.
  Should only be done for an `attach` request.
docstring_tokens: Detect the type for the HTTP response . Should only be done for an attach request .