sunnyman's (sunnyman) wrote in changelog,
sunnyman's
sunnyman
changelog

[ljcom] r11510: LJSUP-11268: Support Cross-Origin Resour...

Committer: vtroitsky
LJSUP-11268: Support Cross-Origin Resource Sharing for LJ XMLRPC API, test script for OPTIONS CORS reguest
A   trunk/bin/test/api_tests/
A   trunk/bin/test/api_tests/xml-rpc/
A   trunk/bin/test/api_tests/xml-rpc/manual/
A   trunk/bin/test/api_tests/xml-rpc/manual/check_cors.pl
Added: trunk/bin/test/api_tests/xml-rpc/manual/check_cors.pl
===================================================================
--- trunk/bin/test/api_tests/xml-rpc/manual/check_cors.pl	                        (rev 0)
+++ trunk/bin/test/api_tests/xml-rpc/manual/check_cors.pl	2012-02-22 08:45:24 UTC (rev 11510)
@@ -0,0 +1,28 @@
+#!/usr/bin/perl -w
+use strict;
+use LWP::UserAgent;
+use HTTP::Request;
+use HTTP::Cookies;
+use Data::Dumper;
+
+my $ua = LWP::UserAgent->new();
+my $domain = 'livejournal.com';
+my $url = "http://www.$domain/interface/xmlrpc";
+my $r = HTTP::Request->new('OPTIONS', $url, [ 'Origin' => 'null', 
+                                            'Access-Control-Request-Headers' => 'origin, content-type',
+                                            'Access-Control-Request-Method' => 'POST' ]);
+
+
+my $cjar = HTTP::Cookies->new(ignore_discard => 1);
+$cjar->set_cookie(undef, 'ljalphaweb02', 1, '/', ".$domain");
+$ua->cookie_jar($cjar);
+my $res = $ua->request($r);
+
+print Dumper($res);
+
+
+
+
+
+
+


Property changes on: trunk/bin/test/api_tests/xml-rpc/manual/check_cors.pl
___________________________________________________________________
Added: svn:executable
   + *

Tags: ljcom, pl, sunnyman, vtroitsky
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments