@openreplay/tracker-axios
Advanced tools
Comparing version 3.4.2 to 3.4.3
@@ -7,2 +7,3 @@ "use strict"; | ||
const url_js_1 = require("./url.js"); | ||
// TODO: test webpack 5 for axios imports | ||
function isAxiosResponse(r) { | ||
@@ -29,2 +30,6 @@ return typeof r === "object" && | ||
const sendFetchMessage = (res) => { | ||
// ?? TODO: why config is undeined sometimes? | ||
if (!isAxiosResponse(res)) { | ||
return; | ||
} | ||
// @ts-ignore | ||
@@ -90,4 +95,6 @@ const startTime = res.config.__openreplayStartTs; | ||
}; | ||
// TODO: why app.safe doesn't work here? | ||
options.instance.interceptors.request.use(function (config) { | ||
if (typeof config !== "object") { | ||
return config; | ||
} // ?? | ||
if (options.sessionTokenHeader) { | ||
@@ -133,3 +140,3 @@ const sessionToken = app.getSessionToken(); | ||
} | ||
// TODO: common case (selector) | ||
// TODO: common case (selector option) for modified responses | ||
if (isAxiosResponse(error)) { | ||
@@ -136,0 +143,0 @@ sendFetchMessage(error); |
@@ -5,2 +5,3 @@ import axios from 'axios'; | ||
import { buildFullPath } from './url.js'; | ||
// TODO: test webpack 5 for axios imports | ||
function isAxiosResponse(r) { | ||
@@ -27,2 +28,6 @@ return typeof r === "object" && | ||
const sendFetchMessage = (res) => { | ||
// ?? TODO: why config is undeined sometimes? | ||
if (!isAxiosResponse(res)) { | ||
return; | ||
} | ||
// @ts-ignore | ||
@@ -88,4 +93,6 @@ const startTime = res.config.__openreplayStartTs; | ||
}; | ||
// TODO: why app.safe doesn't work here? | ||
options.instance.interceptors.request.use(function (config) { | ||
if (typeof config !== "object") { | ||
return config; | ||
} // ?? | ||
if (options.sessionTokenHeader) { | ||
@@ -131,3 +138,3 @@ const sessionToken = app.getSessionToken(); | ||
} | ||
// TODO: common case (selector) | ||
// TODO: common case (selector option) for modified responses | ||
if (isAxiosResponse(error)) { | ||
@@ -134,0 +141,0 @@ sendFetchMessage(error); |
{ | ||
"name": "@openreplay/tracker-axios", | ||
"description": "Tracker plugin for axios requests recording", | ||
"version": "3.4.2", | ||
"version": "3.4.3", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "axios", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18916
359