Skip to content

Commit

Permalink
Merge pull request #33 from contentstack/hotfix/switch_stack
Browse files Browse the repository at this point in the history
fix: fixed switching stack issue
  • Loading branch information
abhinav-from-contentstack committed Mar 21, 2024
2 parents a49f0e7 + 8391a36 commit 96ebbfe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2012-2023 Contentstack
Copyright (c) 2012-2024 Contentstack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions Sources/Stack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ public class Stack: CachePolicyAccessible {
}

var contentstackHTTPHeaders: [AnyHashable: Any] = [
"api_key": apiKey,
"access_token": deliveryToken,
"X-User-Agent": config.sdkVersionString(),
"User-Agent": config.userAgentString()
]
Expand Down Expand Up @@ -194,6 +192,8 @@ public class Stack: CachePolicyAccessible {
private func fetchUrl(_ url: URL, headers:[String: String], cachePolicy: CachePolicy, then completion: @escaping ResultsHandler<Data>) {
var dataTask: URLSessionDataTask?
var request = URLRequest(url: url)
request.setValue(self.deliveryToken, forHTTPHeaderField: "access_token")
request.setValue(self.apiKey, forHTTPHeaderField: "api_key")
for header in headers {
request.addValue(header.value, forHTTPHeaderField: header.key)
}
Expand Down

0 comments on commit 96ebbfe

Please sign in to comment.