Skip to content

Commit

Permalink
Merge a68ac55 into 9c566a1
Browse files Browse the repository at this point in the history
  • Loading branch information
kingster committed Jul 22, 2020
2 parents 9c566a1 + a68ac55 commit 2dcb652
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
10 changes: 9 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ init:
$ErrorActionPreference = "Stop"
git config --global url.https://github.com/.insteadOf git@github.com:
branches:
only:
- master
install:
- appveyor DownloadFile https://dl.bintray.com/boostorg/release/1.68.0/binaries/boost_1_68_0-msvc-14.0-32.exe
- call boost_1_68_0-msvc-14.0-32.exe /SILENT
Expand Down Expand Up @@ -64,27 +66,33 @@ build_script:
cd E:\lib\bcg729\build\
cmake ..
msbuild /m bcg729.sln /p:Configuration=$BuildMode /p:Platform=Win32
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
cd E:\lib\cryptopp
msbuild /m cryptlib.vcxproj /p:Configuration=$BuildMode /p:Platform=Win32 /p:PlatformToolset=v140_xp
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
$wc = New-Object net.webclient; $wc.Downloadfile("https://download.steinberg.net/sdk_downloads/asiosdk_2.3.3_2019-06-14.zip", "E:\lib\portaudio\src\hostapi\asio\asiosdk_2.3.3_2019-06-14.zip")
cd E:\lib\portaudio\src\hostapi\asio
unzip asiosdk_2.3.3_2019-06-14.zip
mv asiosdk_2.3.3_2019-06-14 ASIOSDK
cd E:\lib\portaudio\build\msvc
msbuild /m portaudio.sln /p:Configuration=$BuildMode /p:Platform=Win32
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
cd E:\lib\pjproject
msbuild /m pjproject-vs14.sln -target:libpjproject:Rebuild /p:Configuration=$BuildMode-Static /p:Platform=Win32
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
cd E:\lib\statsd-cpp
cmake .
msbuild /m statsd-cpp.vcxproj /p:Configuration=$BuildMode /p:Platform=Win32
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
cd E:\tinyphone
msbuild /m tinyphone.sln /p:Configuration=$BuildMode /p:Platform=x86
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
Write-Host "`nBuild Completed." -ForegroundColor Yellow
Expand Down
2 changes: 1 addition & 1 deletion tinyphone/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace tp {
contentType = contentTypeIt->second;
}

if (remoteConfig.code / 100 != 2 || contentType != "application/json" ) {
if (remoteConfig.code / 100 != 2 || contentType.rfind("application/json", 0) != 0 ) {
//Try Secondary Location
message = "ERROR: Failed to fetch Remote Config from Primary!";
if (remoteConfig.error != "")
Expand Down
8 changes: 7 additions & 1 deletion tinyphone/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,15 @@ struct TinyPhoneMiddleware
std::chrono::system_clock::time_point start;
};

void before_handle(crow::request& /*req*/, crow::response& /*res*/, context& ctx)
void before_handle(crow::request& req, crow::response& res, context& ctx)
{
ctx.start = std::chrono::system_clock::now();
if (req.method == crow::HTTPMethod::Options){
res.add_header("Access-Control-Allow-Origin", "*");
res.add_header("Access-Control-Allow-Methods", "OPTIONS, GET, HEAD, POST, PUT, DELETE");
res.add_header("Access-Control-Request-Headers", "Content-Type");
res.end();
}
}

void after_handle(crow::request& /*req*/, crow::response& res, context& ctx)
Expand Down

0 comments on commit 2dcb652

Please sign in to comment.