|
Surma |
at Dec 11, 2012 at 2:54 pm
|
⇧ |
| |
https://codereview.appspot.com/6900055/diff/5001/oauth/oauth.goFile oauth/oauth.go (right):
https://codereview.appspot.com/6900055/diff/5001/oauth/oauth.go#newcode254oauth/oauth.go:254: req.Header.Set("Authorization", "Bearer
"+t.AccessToken)
Does Facebook accept "Bearer" headers?
Short answer: Yes.
Long answer: Yes, it is even the only header which is
a) in the official spec[1]
b) supported by all of Google, GitHub and Facebook's OAuth providers
[1]:
http://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-7.1https://codereview.appspot.com/6900055/diff/5001/oauth/oauth.go#newcode298oauth/oauth.go:298: case "application/x-www-form-urlencoded",
"text/plain":
On 2012/12/11 06:33:33, adg wrote:
why text/plain?
“Be liberal in what you accept”, and more hilariously: Because Facebook
doesn't seem to set the `Content-Type` header appropriately. They return
urlencoded data with a `text/plain` content type. Defaulting to
urlencode when getting `text/plain` seems appropriate after browsing the
spec.
https://codereview.appspot.com/6900055/