>There's something wrong here. The payload is not JSON at all, even though >that's what the Content-Type is set to. > >Also, angularjs must not be setting the Origin header in the OPTIONS >request, otherwise Active4D would recognize it as a CORS request.
This is the OPTIONS request but with the response headers being populated by the post execution hook 1. Remote Address: 37.187.129.224:80 2. Request URL: http://glctracker.golf-loisir-club.com/gps/caddyMasterAdd.a4d 3. Request Method: OPTIONS 4. Status Code: 200 OK 5. Request Headersview parsed 1. OPTIONS /gps/caddyMasterAdd.a4d HTTP/1.1 Host: glctracker.golf-loisir-club.com Connection: keep-alive Pragma: no-cache Cache-Control: no-cache Access-Control-Request-Method: POST Origin: http://localhost:9000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.122 Safari/537.36 Access-Control-Request-Headers: accept, content-type Accept: */* Referer: http://localhost:9000/ Accept-Encoding: gzip,deflate,sdch Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4 6. Response Headersview source 1. Access-Control-Allow-Headers: content-type 2. Access-Control-Allow-Methods: GET,POST,PUT,DELETE 3. Access-Control-Allow-Origin: * 4. Access-Control-Max-Age: 10 5. Content-Length: 0 6. Content-Type: text/html; charset=utf-8 7. Date: Wed, 12 Nov 2014 20:56:02 GMT 8. Server: 4D_v12/12.4.0 Also, the POST request that I sent you was the wrong one, this was a test with a query string containing the sid and a payload formatted as a standard formr request just to see if it was making any difference. Below the POST request as normaly issued by angularjs 1. Remote Address: 37.187.129.224:80 2. Request URL: http://glctracker.golf-loisir-club.com/gps/caddyMasterAdd.a4d 3. Request Method: POST 4. Status Code: 200 OK 5. Request Headersview parsed 1. POST /gps/caddyMasterAdd.a4d HTTP/1.1 Host: glctracker.golf-loisir-club.com Connection: keep-alive Content-Length: 45 Pragma: no-cache Cache-Control: no-cache Accept: application/json, text/plain, */* Origin: http://localhost:9000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.122 Safari/537.36 Content-Type: application/json;charset=UTF-8 Referer: http://localhost:9000/ Accept-Encoding: gzip,deflate Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4 6. Request Payloadview source{sid:B1DC5C5B54A98ABE, n:test, i:1} 1. i: "1" 2. n: "test" 3. sid: "B1DC5C5B54A98ABE" 7. Response Headersview source 1. Access-Control-Allow-Headers: content-type 2. Access-Control-Allow-Methods: GET,POST,PUT,DELETE 3. Access-Control-Allow-Origin: * 4. Access-Control-Max-Age: 10 5. Cache-Control: no-cache 6. Content-Length: 1410 7. Content-Type: text/html; charset=utf-8 8. Date: Wed, 12 Nov 2014 20:56:02 GMT 9. Expires: Wed, 12 Nov 2014 20:56:02 GMT 10. Pragma: no-cache 11. Server: 4D_v12/12.4.0 The a4d executable has been reduced just to the minimum to dump the session collection and the form variables. This the result of the above request There is no current session. Unnamed collection Key Value _data_ 45 bytes _______________________________________________ Active4D-dev mailing list [email protected] http://list.aparajitaworld.com/listinfo/active4d-dev Archives: http://active4d-nabble.aparajitaworld.com/
