gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r10895: Fix to sendAndLoad.


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r10895: Fix to sendAndLoad.
Date: Wed, 20 May 2009 14:09:55 +0200
User-agent: Bazaar (1.13.1)

------------------------------------------------------------
revno: 10895
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Wed 2009-05-20 14:09:55 +0200
message:
  Fix to sendAndLoad.
modified:
  libcore/asobj/LoadableObject.cpp
    ------------------------------------------------------------
    revno: 10894.1.1
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Wed 2009-05-20 13:56:39 +0200
    message:
      Make sendAndLoad methods use GET by default as documented in a book. Fixes
      Twitter widget loading again.
    modified:
      libcore/asobj/LoadableObject.cpp
=== modified file 'libcore/asobj/LoadableObject.cpp'
--- a/libcore/asobj/LoadableObject.cpp  2009-03-30 09:49:01 +0000
+++ b/libcore/asobj/LoadableObject.cpp  2009-05-20 11:56:39 +0000
@@ -80,8 +80,8 @@
 
 
 void
-LoadableObject::sendAndLoad(const std::string& urlstr,
-                            as_object& target, bool post)
+LoadableObject::sendAndLoad(const std::string& urlstr, as_object& target,
+        bool post)
 {
 
     /// All objects get a loaded member, set to false.
@@ -471,9 +471,16 @@
 
        boost::intrusive_ptr<as_object> target = fn.arg(1).to_object();
 
-       // Post by default, override by ActionScript third argument
-       bool post = true;
-       if ( fn.nargs > 2 && fn.arg(2).to_string() == "GET" ) post = false;
+    // According to the Flash 8 Cookbook (Joey Lott, Jeffrey Bardzell), p 427,
+    // this method sends by GET unless overridden, and always by GET in the
+    // standalone player. We have no tests for this, but a Twitter widget
+    // gets Bad Request from the server if we send via POST.
+       bool post = false;
+       if (fn.nargs > 2) {
+        const std::string& method = fn.arg(2).to_string();
+        StringNoCaseEqual nc;
+        post = nc(method, "post");
+    }      
 
        ptr->sendAndLoad(urlstr, *target, post);
        return as_value(true);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]