Skip to content

Commit

Permalink
fixed #101, issue with missing API header
Browse files Browse the repository at this point in the history
  • Loading branch information
worthbak committed Dec 15, 2022
1 parent c915540 commit e5857f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 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

0 comments on commit e5857f1

Please sign in to comment.