|
@ -365,17 +365,17 @@ class Parse { |
|
|
$json = $request->get('json'); |
|
|
$json = $request->get('json'); |
|
|
if($json) { |
|
|
if($json) { |
|
|
// Accept GitHub JSON and parse that if provided
|
|
|
// Accept GitHub JSON and parse that if provided
|
|
|
list($data, $json) = Formats\GitHub::parse($this->http, $url, null, $json); |
|
|
|
|
|
|
|
|
list($data, $json, $code) = Formats\GitHub::parse($this->http, $url, null, $json); |
|
|
} else { |
|
|
} else { |
|
|
// Otherwise fetch the post unauthenticated or with the provided access token
|
|
|
// Otherwise fetch the post unauthenticated or with the provided access token
|
|
|
list($data, $json) = Formats\GitHub::parse($this->http, $url, $creds); |
|
|
|
|
|
|
|
|
list($data, $json, $code) = Formats\GitHub::parse($this->http, $url, $creds); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if($data) { |
|
|
if($data) { |
|
|
if($request->get('include_original')) |
|
|
if($request->get('include_original')) |
|
|
$data['original'] = $json; |
|
|
$data['original'] = $json; |
|
|
$data['url'] = $url; |
|
|
$data['url'] = $url; |
|
|
$data['code'] = 200; |
|
|
|
|
|
|
|
|
$data['code'] = $code; |
|
|
return $this->respond($response, 200, $data); |
|
|
return $this->respond($response, 200, $data); |
|
|
} else { |
|
|
} else { |
|
|
return $this->respond($response, 200, [ |
|
|
return $this->respond($response, 200, [ |
|
@ -383,7 +383,7 @@ class Parse { |
|
|
'type' => 'unknown' |
|
|
'type' => 'unknown' |
|
|
], |
|
|
], |
|
|
'url' => $url, |
|
|
'url' => $url, |
|
|
'code' => 0 |
|
|
|
|
|
|
|
|
'code' => $code |
|
|
]); |
|
|
]); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|