Master0007 / oauth

Automatically exported from code.google.com/p/oauth
0 stars 0 forks source link

PHP to_header problems #105

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use the to_header function

Expected output is authorisation header.
Instead the first part of the header is missing while realm can-not be set.

This includes support for specifying the realm.

  /**
   * builds the Authorization: header
   */
  public function to_header($realm='') {
    $total = array();
    if (!empty($realm)) {
        $total[] = 'Authorization: OAuth realm="'.$realm.'"';
    } else {
        $total[] = 'Authorization: OAuth';
    }
    foreach ($this->parameters as $k => $v) {
      if (substr($k, 0, 5) != "oauth") continue;
      $total[] = OAuthUtil::urlencodeRFC3986($k) . '="' . 
OAuthUtil::urlencodeRFC3986($v) . '"';
    }
    $out = implode(",", $total);
    return $out;
  }

Original issue reported on code.google.com by meisteryellow@gmail.com on 11 Jun 2009 at 2:47

GoogleCodeExporter commented 9 years ago

Original comment by leah.culver on 12 Aug 2009 at 9:22

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1163.

Original comment by morten.f...@gmail.com on 5 Jan 2010 at 11:31