Skip to content

Commit

Permalink
Merge pull request #102 from worthbak/wb/apple-referer-bugfix
Browse files Browse the repository at this point in the history
fixed #101, issue with missing API header
  • Loading branch information
worthbak authored Dec 15, 2022
2 parents c915540 + 5d52946 commit 9c63fad
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions InventoryWatch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.5;
MARKETING_VERSION = 0.2.1;
MARKETING_VERSION = 0.2.2;
PRODUCT_BUNDLE_IDENTIFIER = com.worthbak.InventoryWatch;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down Expand Up @@ -435,7 +435,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.5;
MARKETING_VERSION = 0.2.1;
MARKETING_VERSION = 0.2.2;
PRODUCT_BUNDLE_IDENTIFIER = com.worthbak.InventoryWatch;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down
5 changes: 4 additions & 1 deletion InventoryWatch/Model/FulfillmentModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,13 @@ actor FulfillmentModel {
throw AppError.couldNotGenerateURL
}

var request = URLRequest(url: url)
request.addValue("https://www.apple.com/shop/buy-iphone/", forHTTPHeaderField: "Referer")

// Log the URL for debugging
print(url.absoluteString)

let (data, response) = try await URLSession.shared.data(from: url)
let (data, response) = try await URLSession.shared.data(for: request)
return try await parseStoreResponse(data, response: response as? HTTPURLResponse, filterForModels: modelParsingFilter)
}

Expand Down
Binary file removed docs/InventoryWatch-0.2.1.zip
Binary file not shown.
Binary file added docs/InventoryWatch-0.2.2.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## [Download InventoryWatch (0.2.1) Now ⤵️](./InventoryWatch-0.2.1.zip)
## [Download InventoryWatch (0.2.2) Now ⤵️](./InventoryWatch-0.2.2.zip)

![InventoryWatch-Screenshot](./ic-mkt.jpg)

Expand Down Expand Up @@ -68,4 +68,4 @@ macOS Big Sur 11.5 or newer. InventoryWatch is built with SwiftUI.

## Ready to go?

[Download InventoryWatch (0.2.1) Now ⤵️](./InventoryWatch-0.2.1.zip)
[Download InventoryWatch (0.2.2) Now ⤵️](./InventoryWatch-0.2.2.zip)

0 comments on commit 9c63fad

Please sign in to comment.