Skip to content

Commit

Permalink
Parse oauth(2)? requests correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
mynetx committed Aug 20, 2013
1 parent 90c1adb commit b1bdd95
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion codebird-cors-proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,14 @@ function http_get_request_body()

}

// URLs always start with 1.1
// URLs always start with 1.1 or oauth
$version_pos = strpos($url, '/1.1/');
if ($version_pos === -1) {
$version_pos = strpos($url, '/oauth/');
}
if ($version_pos === -1) {
$version_pos = strpos($url, '/oauth2/');
}
if ($version_pos === -1) {
header('HTTP/1.1 412 Precondition failed');
die('This proxy only supports requests to API version 1.1.');
Expand Down

0 comments on commit b1bdd95

Please sign in to comment.