Skip to content

Commit

Permalink
Consider status codes <200
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-el committed Oct 23, 2023
1 parent 1df5e9f commit f43467e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@snowplow/browser-tracker-core",
"comment": "Consider status codes <200",
"type": "none"
}
],
"packageName": "@snowplow/browser-tracker-core"
}
4 changes: 2 additions & 2 deletions libraries/browser-tracker-core/src/tracker/out_queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,9 @@ export function OutQueueManager(
};

xhr.onreadystatechange = function () {
if (xhr.readyState === 4 && xhr.status >= 200) {
if (xhr.readyState === 4) {
clearTimeout(xhrTimeout);
if (xhr.status < 300) {
if (xhr.status >= 200 && xhr.status < 300) {
onPostSuccess(numberToSend);
} else {
if (!shouldRetryForStatusCode(xhr.status)) {
Expand Down

0 comments on commit f43467e

Please sign in to comment.