Skip to content

Commit

Permalink
CORS fixes for content-type (#73)
Browse files Browse the repository at this point in the history
* Allow content-type via Access-Control-Allow-Headers
* Bump version to 36.0.0.83
* Github actions updates
  • Loading branch information
kingster authored Feb 15, 2023
1 parent 24f05d8 commit 900407b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
continue-on-error: true
- name: Set vars
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Build and Push tinyphone_base to registry
if: contains(steps.changed_files.outputs.modified, 'Dockerfile.base')
run: |
Expand All @@ -53,7 +53,7 @@ jobs:
cat ./distribution/docker/release.ps1 | docker run -v ${PWD}:"C:\Code\tinyphone" -i ghcr.io/${{ github.repository_owner }}/tinyphone_base:vc2019
- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: tinyphone_installer
path: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
submodules: 'recursive'

- name: Restore Boost Cache
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-boost
with:
path: C:\local\boost_1_74_0
Expand All @@ -49,7 +49,7 @@ jobs:
Start-Process -Wait -FilePath "$env:TEMP\wix311.exe" "/install","/quiet","/norestart"
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
uses: microsoft/setup-msbuild@v1.1
- name: Configure build for Windows MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
Expand All @@ -61,7 +61,7 @@ jobs:
.\distribution\docker\release.ps1 -ErrorAction Stop
- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: tinyphone.msi
path: |
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
# codesign --force --sign "Apple Development" tinyphone.dmg
- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: tinyphone.dmg
path: |
Expand Down Expand Up @@ -222,7 +222,7 @@ jobs:
make
- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: tinyphone.linux
path: |
Expand Down
4 changes: 2 additions & 2 deletions tinyphone-osx/Tinyphone.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@
/usr/local/lib,
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 36.0.0.82;
MARKETING_VERSION = 36.0.0.83;
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-DBOOST_SYSTEM_DYN_LINK",
Expand Down Expand Up @@ -678,7 +678,7 @@
/usr/local/lib,
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 36.0.0.82;
MARKETING_VERSION = 36.0.0.83;
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-DBOOST_SYSTEM_DYN_LINK",
Expand Down
26 changes: 13 additions & 13 deletions tinyphone/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,19 @@ void TinyPhoneHttpServer::Start() {
};
return tp::response(200, response);
});
CROW_ROUTE(app, "/config")([]() {
std::string productVersion;
GetProductVersion(productVersion);
json response = {
{ "version", productVersion },
{ "config", tp::ApplicationConfig},
{ "sip-log-file", tp::sipLogFile},
{ "http-log-file", tp::httpLogFile},
};
return tp::response(200, response);
});
CROW_ROUTE(app, "/config")([]() {
std::string productVersion;
GetProductVersion(productVersion);
json response = {
{ "version", productVersion },
{ "config", tp::ApplicationConfig},
{ "sip-log-file", tp::sipLogFile},
{ "http-log-file", tp::httpLogFile},
};
return tp::response(200, response);
});

std::unordered_set<crow::websocket::connection*> subscribers;

Expand Down
1 change: 1 addition & 0 deletions tinyphone/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ struct TinyPhoneMiddleware
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.add_header("Access-Control-Allow-Headers", "Content-Type");
res.end();
}
}
Expand Down
4 changes: 2 additions & 2 deletions tinyphone/stampver.inf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;StampVer information file
FileVersion=36.0.0.82
ProductVersion=36.0.0.82
FileVersion=36.0.0.83
ProductVersion=36.0.0.83
FileFormat=%a.%b.%c
ProductFormat=%a.%b.%c

0 comments on commit 900407b

Please sign in to comment.