Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

Commit f478258

Browse files
feat: add feature to skip body verifiction (#21)
For now we want to skip body verification.
1 parent 5967469 commit f478258

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Release
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- main
@@ -55,14 +56,14 @@ jobs:
5556
cargo install cargo-deb --target x86_64-unknown-linux-musl
5657
echo "1.55.0" >./rust-toolchain
5758
rustup target add x86_64-unknown-linux-musl
58-
RUSTFLAGS="--remap-path-prefix=${GITHUB_WORKSPACE}=/builds/dfinity" cargo deb --target x86_64-unknown-linux-musl -- --locked
59+
RUSTFLAGS="--remap-path-prefix=${GITHUB_WORKSPACE}=/builds/dfinity" cargo deb --target x86_64-unknown-linux-musl -- --locked --features=skip_body_verification
5960
if: contains(matrix.target, 'linux-musl')
6061

6162
- name: Linux build (gnu)
6263
env:
6364
RUSTFLAGS: --remap-path-prefix=${GITHUB_WORKSPACE}=/builds/dfinity
6465
run: |
65-
cargo build --locked --release --target x86_64-unknown-linux-gnu
66+
cargo build --locked --release --target x86_64-unknown-linux-gnu --features=skip_body_verification
6667
cd ${{ matrix.binary_path }}
6768
ldd icx-proxy
6869
if: contains(matrix.target, 'linux-gnu')
@@ -71,7 +72,7 @@ jobs:
7172
env:
7273
RUSTFLAGS: --remap-path-prefix=${GITHUB_WORKSPACE}=/builds/dfinity
7374
run: |
74-
cargo build --locked --release
75+
cargo build --locked --release --features=skip_body_verification
7576
cd target/release
7677
otool -L icx-proxy
7778
if: contains(matrix.os, 'macos')

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ slog = { version = "2.7.0", features = ["max_level_trace"] }
3737
slog-async = "2.7.0"
3838
slog-term = "2.8.0"
3939
url = "2.2.1"
40+
41+
[features]
42+
skip_body_verification = []

src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,8 @@ async fn forward_request(
422422
// Canisters don't have to provide certified variables
423423
(None, None) => true,
424424
};
425-
if !body_valid {
425+
426+
if !body_valid && !cfg!(feature = "skip_body_verification") {
426427
return Ok(Response::builder()
427428
.status(StatusCode::INTERNAL_SERVER_ERROR)
428429
.body("Body does not pass verification".into())

0 commit comments

Comments
 (0)