Skip to content

Commit 37ed5a4

Browse files
committed
Location redirect
1 parent 0a9aed0 commit 37ed5a4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@puzzle-js/client-lib",
33
"main": "dist/index.js",
4-
"version": "1.2.3",
4+
"version": "1.2.4",
55
"author": "<emre.kul@trendyol.com>",
66
"license": "MIT",
77
"repository": {

src/core.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,11 @@ export class Core extends Module {
157157
});
158158
}
159159

160-
if (res['$headers'] && res['$headers'].location) {
161-
return location.href = res['$headers'].location;
160+
if (res['$headers']) {
161+
const locationRedirect = res['$headers'].location || res['$headers'].Location;
162+
if (locationRedirect) {
163+
return location.href = res['$headers'].location;
164+
}
162165
}
163166

164167
Object.keys(res).forEach(key => {

0 commit comments

Comments
 (0)