Skip to content

Commit

Permalink
Add Referer header to request api
Browse files Browse the repository at this point in the history
  • Loading branch information
alexiscn committed Jan 21, 2022
1 parent 2ecee8a commit 19d9561
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions StocksBar.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -579,15 +579,15 @@
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 17;
CURRENT_PROJECT_VERSION = 18;
DEVELOPMENT_TEAM = LX863G777H;
INFOPLIST_FILE = "$(SRCROOT)/StocksBar/Supporting Files/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 1.7;
MARKETING_VERSION = 1.8;
PRODUCT_BUNDLE_IDENTIFIER = me.shuifeng.StocksBar;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -604,15 +604,15 @@
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 17;
CURRENT_PROJECT_VERSION = 18;
DEVELOPMENT_TEAM = LX863G777H;
INFOPLIST_FILE = "$(SRCROOT)/StocksBar/Supporting Files/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 1.7;
MARKETING_VERSION = 1.8;
PRODUCT_BUNDLE_IDENTIFIER = me.shuifeng.StocksBar;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
2 changes: 1 addition & 1 deletion StocksBar/Networking/SinaStocksAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class SinaStocksAPI: StocksAPI {
}
let code = mappedCodes.joined(separator: ",")
let url = aURL.appending(code)
AF.request(url).responseData { response in
AF.request(url, headers: HTTPHeaders([HTTPHeader(name: "Referer", value: "https://finance.sina.com.cn/stock/")])).responseData { response in
switch response.result {
case .success(let data):
//let content = String(data: data, encoding: .utf8)
Expand Down
8 changes: 4 additions & 4 deletions StocksBar/Storyboards/AboutWindow.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="HN3-sQ-F4u">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="HN3-sQ-F4u">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="18122"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19529"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -49,14 +49,14 @@
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="G7Y-Oi-afQ">
<rect key="frame" x="133" y="61" width="19" height="14"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="1.7" id="fwc-EO-rwS">
<textFieldCell key="cell" lineBreakMode="clipping" title="1.8" id="fwc-EO-rwS">
<font key="font" metaFont="controlContent" size="11"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="WS1-Y1-nFd">
<rect key="frame" x="16" y="20" width="252" height="14"/>
<rect key="frame" x="16" y="20" width="253" height="14"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Copyright © 2021 Shuifeng. All rights reserved." id="6C2-Fd-k3s">
<font key="font" metaFont="controlContent" size="11"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
Expand Down

0 comments on commit 19d9561

Please sign in to comment.