11 messages in com.googlegroups.google-appengine[google-appengine] Re: Is there a way...
FromSent OnAttachments
toddJun 3, 2008 3:26 pm 
toddJun 5, 2008 11:11 pm 
James StrachanJun 6, 2008 10:48 pm 
joh...@easypublisher.comJun 7, 2008 7:46 am 
joh...@easypublisher.comJun 7, 2008 7:54 am 
James StrachanJun 7, 2008 9:56 am 
James StrachanJun 10, 2008 4:30 am 
Ryan WJul 8, 2008 11:22 pm 
Ryan WJul 9, 2008 8:55 am 
James StrachanJul 15, 2008 5:42 am 
Jorge VargasJul 16, 2008 7:31 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[google-appengine] Re: Is there a way to make sure HTTP_REFERER is not set?Actions...
From:joh...@easypublisher.com (joh@easypublisher.com)
Date:Jun 7, 2008 7:54:33 am
List:com.googlegroups.google-appengine

To answer my own question:

On Apr 9, 2007, at 2:12 PM, rag wrote: "Sorry, due to abusive behaviour, we have been forced to disable posting from external websites. If you are posting from an API tool, please ensure that the HTTP_REFERER header is not set."

So it seems like your not allowed to post to twitter from external web sites.

Looking at urlfetch.py, I'm wondering if it would be possible to override the fetch function (e.g. roll your own) and intercept the request after it's been generated from urlfetch_service_pb.URLFetchRequest(), assuming it is URLFetchRequest() that addes the unwanted headers. (Just a wild idea, if you try it let me know).

/Johan

Any reason why twitter API has this requirement? /Johan

On 6/7/08, James Strachan <jame@gmail.com> wrote:

Damn I just hit this too. I wonder why the referer is mandatory from GAE?

2008/6/6 todd <tm@possibility.com>:

It turns out GAE automatically adds a Referer header and Referer is said to be one of the headers you can't change. That means you can't post to Twitter from GAE.

Howdy,

I've been using GAE to make Twitter calls. In the last few days my Twitter API calls started failing with this error:

403 Forbidden: The server understood the request, but is refusing to fulfill it. If you are posting from an API tool please ensure that the HTTP_REFERER header is not set.

To my knowledge I'm not setting referer (code appended). My code has been working for a long time after Twitter required HTTP_REFERER header to not be set.

Has anything changed on the GAE side? The code works from the test web server but fails when published into the cloud.

Any thoughts on what might be happening or what I can do about it?

thanx

class SendChime(webapp.RequestHandler): def get(self): self.response.headers['Content-Type'] = 'text/plain' username = self.request.get("username")

logging.debug("Sending chime for user=" + username) login = username; password = password chime = self.get_chime() payload= {'status' : chime, 'source' : "innertwitter"} payload= urllib.urlencode(payload)

base64string = base64.encodestring('%s:%s' % (login, password)) [:-1] headers = {'Authorization': "Basic %s" % base64string}

url = "http://twitter.com/statuses/update.xml" result = urlfetch.fetch(url, payload=payload, method=urlfetch.POST, headers=headers)

self.response.out.write(result.content)

-- James

------- http://macstrac.blogspot.com/

Open Source Integration http://open.iona.com