Tweet button not working with a 'localhost' data-url?

1,117 views
Skip to first unread message

Olivier K

unread,
Oct 6, 2010, 4:29:45 PM10/6/10
to Twitter Development Talk
Hi, I'm currently testing the tweet button for our website. When I
test the button locally and want to share a link in the form of
'http://localhost:8080/somepath/image.jpg' its says that the 'url'
param is invalid. But when I test it on a 'real' server (like
example.com) the button does work.
The data-url attribures are dynamically generated, which means if the
file was on 'example.com' instead of 'localhost' the link would be
'http://example.com/somepath/image.jpg'
Can anyone confirm that share does not work with 'localhost' as data-
url?

Thanks,

Olivier.

John Adams

unread,
Oct 6, 2010, 4:36:14 PM10/6/10
to twitter-deve...@googlegroups.com
There were recently some anti-XSS patches made to our code that might be blocking your use of "localhost".

-j


--
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: http://groups.google.com/group/twitter-development-talk

Matt Harris

unread,
Oct 6, 2010, 4:51:57 PM10/6/10
to twitter-deve...@googlegroups.com
http://localhost is not a shareable URL so this error is expected.
Instead, if you need to test things locally you might want to add a
development domain name into your computers hosts file instead.

Hope that helps,

@themattharris
Developer Advocate, Twitter
http://twitter.com/themattharris

On Wed, Oct 6, 2010 at 1:29 PM, Olivier K <okit...@gmail.com> wrote:

Tom van der Woerdt

unread,
Oct 6, 2010, 4:52:48 PM10/6/10
to twitter-deve...@googlegroups.com
Why would you want to generate a link that would only work for you? Just
accept that it will not work and you'll be fine ;-)

Tom

Reply all
Reply to author
Forward
0 new messages