Skip to content

Commit

Permalink
fix: fixed region issue
Browse files Browse the repository at this point in the history
setting region host when region is provided
  • Loading branch information
harshithad0703 committed Jun 6, 2024
1 parent 6bc9b45 commit adca5fb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Change log

### Version: 4.0.3
#### Date: June-11-2024
Fixed region issue

### Version: 4.0.2
#### Date: June-03-2024
Custom host implementation
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/delivery-sdk",
"version": "4.0.2",
"version": "4.0.3",
"type": "commonjs",
"main": "./dist/cjs/src/index.js",
"types": "./dist/types/src/index.d.ts",
Expand Down
3 changes: 1 addition & 2 deletions src/lib/contentstack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,11 @@ export function stack(config: StackConfig): StackClass {
config.live_preview.host = config.host
}
} else {
defaultConfig.defaultHostname = config.host ? config.host : getHost(config.region, config.host);
config.host = config.host || defaultConfig.defaultHostname;
defaultConfig.live_preview = config.live_preview
}

defaultConfig.defaultHostname = config.host ? config.host : getHost(config.region, config.host);

if (config.apiKey) {
defaultConfig.headers.api_key = config.apiKey;
} else {
Expand Down

0 comments on commit adca5fb

Please sign in to comment.