title: AJAX POST request with CakePHP causing 400 response (blackhole)
body: <p>I just added SSL to my Ubuntu 12.04 apache2 server running a Cake 2.3.8 app. I made sure to add https://... in front of every single call and confirmed using grep. There are no blocked scripts that I'm aware of. When I try to make AJAX post requests from a JS file to my server with AJAX I get an error like</p>
  
  <pre><code>The request has been black-holed
  Error: The requested address '/sorts/available_spaces' was not found on this server.
  </code></pre>
  
  <p>In my JS file which makes the POST request I have</p>
  
  <pre><code>$.post("https://www.mywebsite.com/sorts/available_spaces",{'customerID' : self.customerID, 'arrivalDate' : self.arrivalDate},function(data) {
      data = JSON.parse(data);
      for(i=0;i&lt;data.length;i++){
          self.roomNumberList.push({spaceNumber: data[i].spaceNumber, roomID: data[i].roomID});
      }
  });
  </code></pre>
  
  <p>In my SortsController I even tried to set access control origin to allow everything and disabled security (temporarily), but I still get the black hole request</p>
  
  <pre><code>//SortsController
  
  var $components = array('Security');
  
  public function beforeFilter(){
      $this-&gt;response-&gt;header('Access-Control-Allow-Origin', '*');
      $this-&gt;Security-&gt;unlockedActions = array('available_spaces', check_reservation');
      $this-&gt;Auth-&gt;allow('available_spaces','check_reservation');
      $this-&gt;Security-&gt;csrfCheck = false;
      $this-&gt;Security-&gt;validatePost = false;
      parent::beforeFilter();
  }
  </code></pre>
  
  <p>Even in the available_spaces method there are no calls to other methods or anything outside of the SortsController. I don't have anything in my Sort model and I don't call security at all in my AppController.</p>
  
  <p>Here's the stack trace. I don't even see a mention of the SortsController or method aside from routing.</p>
  
  <pre><code> CORE/Cake/Controller/Component/SecurityComponent.php line 241 → SecurityComponent-&gt;blackHole(SortsController, string)
  [internal function] → SecurityComponent-&gt;startup(SortsController)
  CORE/Cake/Utility/ObjectCollection.php line 132 → call_user_func_array(array, array)
  [internal function] → ObjectCollection-&gt;trigger(CakeEvent)
  CORE/Cake/Event/CakeEventManager.php line 248 → call_user_func(array, CakeEvent)
  CORE/Cake/Controller/Controller.php line 675 → CakeEventManager-&gt;dispatch(CakeEvent)
  CORE/Cake/Routing/Dispatcher.php line 184 → Controller-&gt;startupProcess()
  CORE/Cake/Routing/Dispatcher.php line 162 → Dispatcher-&gt;_invoke(SortsController, CakeRequest, CakeResponse)
  APP/webroot/index.php line 118 → Dispatcher-&gt;dispatch(CakeRequest, CakeResponse)
  </code></pre>