First of, there is a bug in OAuthRequest.from_request in that the port-
number isn't kept..
Here's a quick table how URI's are parsed and how they should be parsed
URI -> Correct -> Current
http://example.com/ -> http://example.com/ -> http://example.com/
http://example.com:80/ -> http://example.com/ -> http://example.com/
http://example.com:8080/ -> http://example.com:8080/ -> http://example.com/
(WRONG)
https://example.com/ -> https://example.com/ -> https://example.com/
https://example.com:443/ -> https://example.com/ -> https://example.com/
https://example.com:8443/ -> https://example.com:8443/ -> https://example.com/
(WRONG)
So I have attached a patch (20080116_scheme_port_fix.patch) that
attaches :_port_ if
it's any other combo than http:80 or https:443
Secondly OAuthRequest.split_headers is wrong.. It will fail to parse
Auth.-headers like
OAuth realm="",oauth_foo=bar,oauth_baz="bla,rgh"
So I have attached a patch (20081016_split_headers.patch) that changes
the way
split_headers() work, from using strpos/explode to a iterated reg.exp.
And as a third thing, arrays in input-data are.. handled wrong.. (You
get a error trying)
I have yet to fix this.. But I will do it when I get the time..
I am using a PHPUnit test-case to run OAuthRequest through a series of
tests, running
through most of the test-cases that the OAuth.net wiki articles
mentions under signing etc
It's pretty rough, and not really foolproof (works by setting alot of
$_SERVER-variables
tricking the library into parsing it they way I want it to)
In the future I will expand the coverage to all the classes in
OAuth.php, but it takes time..
Lots of time..
Let me know if it's of general interest to get these PHPUnit-files
into SVN..
Also - how about that commit-right.. :P
Regards
-fangel