Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaelHeerklotz <michael.heerklotz@web.de>2019-07-17 07:13:56 +0300
committerThomas Steur <tsteur@users.noreply.github.com>2019-07-17 07:13:56 +0300
commit4596f59b79788993a16b1836be1881d0943cbb38 (patch)
treea4f2ed05803d2a696ecafcdb94d314e6db4f3217 /tests/javascript
parent6411472b183195162d3dbfa8b7e649bcaba812ba (diff)
Fix missing 3rd party cookie when using POST requests (#14368)
* Fix missing 3rd party cookie when using POST requests * fix test * jslint fix * Update piwik.min.js * Update matomo.js * Update piwik.js
Diffstat (limited to 'tests/javascript')
-rw-r--r--tests/javascript/index.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/javascript/index.php b/tests/javascript/index.php
index cdb17efb8a..d8362dbb58 100644
--- a/tests/javascript/index.php
+++ b/tests/javascript/index.php
@@ -3293,6 +3293,30 @@ function PiwikTest() {
ok( -1 !== tracker.getRequest('hello=world').indexOf('send_image=0'), 'should disable sending image response');
});
+ test("POST requests are sent with cookies", function() {
+ expect(3);
+
+ var tracker = Piwik.getTracker();
+ tracker.setTrackerUrl("matomo.php");
+ tracker.setSiteId(1);
+ tracker.setCustomData({ "token": '---' });
+ tracker.setRequestMethod('POST');
+
+ var callbackCalled = false;
+ tracker.trackPageView('withCredentialsTest', null, function (event) {
+ callbackCalled = true;
+ ok(event.success, 'succeeded');
+ ok(event.xhr && event.xhr.withCredentials, 'withCredentials is true');
+ });
+
+ stop();
+ setTimeout(function() {
+ ok(callbackCalled, 'called the callback');
+
+ start();
+ }, 2000);
+ });
+
// support for setCustomRequestProcessing( customRequestContentProcessingLogic )
test("Tracker setCustomRequestProcessing() and getRequest()", function() {
expect(4);