Skip to content

Commit 34b6eb7

Browse files
committed
review: header-value -> strict-header-value.
Signed-off-by: Piotr Sikora <[email protected]>
1 parent ca5ea40 commit 34b6eb7

File tree

9 files changed

+93
-93
lines changed

9 files changed

+93
-93
lines changed

.github/workflows/rust.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
9797
- name: Format (rules_rust)
9898
run: |
99-
sed -i'' -E 's/^default = \[\]/default = \[\"header-value\"\]/' Cargo.toml
99+
sed -i'' -E 's/^default = \[\]/default = \[\"strict-header-value\"\]/' Cargo.toml
100100
bazelisk --noworkspace_rc run --noenable_bzlmod //bazel/cargo:crates_vendor
101101
git checkout Cargo.toml
102102
git diff --exit-code
@@ -152,17 +152,17 @@ jobs:
152152
- name: Clippy (wasm32-wasi)
153153
run: cargo clippy --release --all-targets --target=wasm32-wasi
154154

155-
- name: Build (header-value)
156-
run: cargo build --release --all-targets --target=wasm32-wasi --features header-value
155+
- name: Build (strict-header-value)
156+
run: cargo build --release --all-targets --target=wasm32-wasi --features strict-header-value
157157

158-
- name: Clippy (header-value)
159-
run: cargo clippy --release --all-targets --target=wasm32-wasi --features header-value
158+
- name: Clippy (strict-header-value)
159+
run: cargo clippy --release --all-targets --target=wasm32-wasi --features strict-header-value
160160

161161
- name: Test
162162
run: cargo test
163163

164-
- name: Test (header-value)
165-
run: cargo test --features header-value
164+
- name: Test (strict-header-value)
165+
run: cargo test --features strict-header-value
166166

167167
- name: Format (rustfmt)
168168
run: cargo fmt -- --check
@@ -226,17 +226,17 @@ jobs:
226226
- name: Clippy (wasm32-wasip1)
227227
run: cargo clippy --release --all-targets --target=wasm32-wasip1
228228

229-
- name: Build (header-value)
230-
run: cargo build --release --all-targets --target=wasm32-wasip1 --features header-value
229+
- name: Build (strict-header-value)
230+
run: cargo build --release --all-targets --target=wasm32-wasip1 --features strict-header-value
231231

232-
- name: Clippy (header-value)
233-
run: cargo clippy --release --all-targets --target=wasm32-wasip1 --features header-value
232+
- name: Clippy (strict-header-value)
233+
run: cargo clippy --release --all-targets --target=wasm32-wasip1 --features strict-header-value
234234

235235
- name: Test
236236
run: cargo test
237237

238-
- name: Test (header-value)
239-
run: cargo test --features header-value
238+
- name: Test (strict-header-value)
239+
run: cargo test --features strict-header-value
240240

241241
- name: Format (rustfmt)
242242
run: cargo fmt -- --check
@@ -301,23 +301,23 @@ jobs:
301301
- name: Clippy (wasm32-wasip1)
302302
run: cargo clippy --release --all-targets --target=wasm32-wasip1
303303

304-
- name: Build (header-value)
305-
run: cargo build --release --all-targets --target=wasm32-wasip1 --features header-value
304+
- name: Build (strict-header-value)
305+
run: cargo build --release --all-targets --target=wasm32-wasip1 --features strict-header-value
306306

307-
- name: Clippy (header-value)
308-
run: cargo clippy --release --all-targets --target=wasm32-wasip1 --features header-value
307+
- name: Clippy (strict-header-value)
308+
run: cargo clippy --release --all-targets --target=wasm32-wasip1 --features strict-header-value
309309

310310
- name: Test
311311
run: cargo test
312312

313-
- name: Test (header-value)
314-
run: cargo test --features header-value
313+
- name: Test (strict-header-value)
314+
run: cargo test --features strict-header-value
315315

316316
- name: Bench
317317
run: cargo bench
318318

319-
- name: Bench (header-value)
320-
run: cargo bench --features header-value
319+
- name: Bench (strict-header-value)
320+
run: cargo bench --features strict-header-value
321321

322322
- name: Format (rustfmt)
323323
run: cargo fmt -- --check

BUILD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ rust_library(
4040
)
4141

4242
rust_library(
43-
name = "proxy_wasm_header_value",
43+
name = "proxy_wasm_strict_header_value",
4444
srcs = glob(["src/*.rs"]),
45-
crate_features = ["header-value"],
45+
crate_features = ["strict-header-value"],
4646
crate_name = "proxy_wasm",
4747
edition = "2018",
4848
visibility = ["//visibility:public"],
@@ -78,7 +78,7 @@ rust_binary(
7878
rustc_flags = ["-Cstrip=debuginfo"],
7979
visibility = ["//visibility:private"],
8080
deps = [
81-
":proxy_wasm_header_value",
81+
":proxy_wasm_strict_header_value",
8282
"//bazel/cargo/remote:log",
8383
],
8484
)

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ log = "0.4"
1818

1919
[features]
2020
default = []
21-
header-value = ["dep:bytes", "dep:http"]
21+
strict-header-value = ["dep:bytes", "dep:http"]
2222

2323
[profile.release]
2424
lto = true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
This crate supports the following optional features:
2020

21-
- `header-value` - uses RFC-compliant `HeaderValue` instead of UTF-8 `String` for HTTP header and trailer values.
21+
- `strict-header-value` - uses RFC-compliant `HeaderValue` instead of UTF-8 `String` for HTTP header and trailer values.
2222
This will become the default in future releases.
2323

2424
## Examples

examples/grpc_auth_random/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ crate-type = ["cdylib"]
1111

1212
[dependencies]
1313
log = "0.4"
14-
proxy-wasm = { path = "../../", features = ["header-value"] }
14+
proxy-wasm = { path = "../../", features = ["strict-header-value"] }
1515

1616
[profile.release]
1717
lto = true

examples/http_headers/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ crate-type = ["cdylib"]
1212

1313
[dependencies]
1414
log = "0.4"
15-
proxy-wasm = { path = "../../", features = ["header-value"] }
15+
proxy-wasm = { path = "../../", features = ["strict-header-value"] }
1616

1717
[profile.release]
1818
lto = true

src/hostcalls.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ extern "C" {
145145
) -> Status;
146146
}
147147

148-
#[cfg(feature = "header-value")]
148+
#[cfg(feature = "strict-header-value")]
149149
pub fn get_map(map_type: MapType) -> Result<Vec<(String, HeaderValue)>, Status> {
150150
unsafe {
151151
let mut return_data: *mut u8 = null_mut();
@@ -165,7 +165,7 @@ pub fn get_map(map_type: MapType) -> Result<Vec<(String, HeaderValue)>, Status>
165165
}
166166
}
167167

168-
#[cfg(not(feature = "header-value"))]
168+
#[cfg(not(feature = "strict-header-value"))]
169169
pub fn get_map(map_type: MapType) -> Result<Vec<(String, String)>, Status> {
170170
unsafe {
171171
let mut return_data: *mut u8 = null_mut();
@@ -237,7 +237,7 @@ extern "C" {
237237
) -> Status;
238238
}
239239

240-
#[cfg(feature = "header-value")]
240+
#[cfg(feature = "strict-header-value")]
241241
pub fn get_map_value(map_type: MapType, key: &str) -> Result<Option<HeaderValue>, Status> {
242242
let mut return_data: *mut u8 = null_mut();
243243
let mut return_size: usize = 0;
@@ -268,7 +268,7 @@ pub fn get_map_value(map_type: MapType, key: &str) -> Result<Option<HeaderValue>
268268
}
269269
}
270270

271-
#[cfg(not(feature = "header-value"))]
271+
#[cfg(not(feature = "strict-header-value"))]
272272
pub fn get_map_value(map_type: MapType, key: &str) -> Result<Option<String>, Status> {
273273
let mut return_data: *mut u8 = null_mut();
274274
let mut return_size: usize = 0;
@@ -1182,9 +1182,9 @@ pub fn increment_metric(metric_id: u32, offset: i64) -> Result<(), Status> {
11821182

11831183
mod utils {
11841184
use crate::types::Bytes;
1185-
#[cfg(feature = "header-value")]
1185+
#[cfg(feature = "strict-header-value")]
11861186
use crate::types::HeaderValue;
1187-
#[cfg(feature = "header-value")]
1187+
#[cfg(feature = "strict-header-value")]
11881188
use bytes::Buf;
11891189
use std::convert::TryFrom;
11901190

@@ -1232,7 +1232,7 @@ mod utils {
12321232
serialize_map(map)
12331233
}
12341234

1235-
#[cfg(feature = "header-value")]
1235+
#[cfg(feature = "strict-header-value")]
12361236
pub(super) fn deserialize_map(mut bytes: bytes::Bytes) -> Vec<(String, HeaderValue)> {
12371237
if bytes.is_empty() {
12381238
return Vec::new();
@@ -1258,7 +1258,7 @@ mod utils {
12581258
map
12591259
}
12601260

1261-
#[cfg(not(feature = "header-value"))]
1261+
#[cfg(not(feature = "strict-header-value"))]
12621262
pub(super) fn deserialize_map(bytes: &[u8]) -> Vec<(String, String)> {
12631263
if bytes.is_empty() {
12641264
return Vec::new();
@@ -1440,7 +1440,7 @@ mod utils {
14401440
assert_eq!(serialized_map, SERIALIZED_MAP);
14411441
}
14421442

1443-
#[cfg(feature = "header-value")]
1443+
#[cfg(feature = "strict-header-value")]
14441444
#[test]
14451445
fn test_deserialize_map_all_chars() {
14461446
// We're intentionally accepting all values to support hosts and proxies that
@@ -1456,7 +1456,7 @@ mod utils {
14561456
}
14571457
}
14581458

1459-
#[cfg(not(feature = "header-value"))]
1459+
#[cfg(not(feature = "strict-header-value"))]
14601460
#[test]
14611461
fn test_deserialize_map_all_chars() {
14621462
// 0x00-0x7f are valid single-byte UTF-8 characters.
@@ -1513,7 +1513,7 @@ mod utils {
15131513
});
15141514
}
15151515

1516-
#[cfg(feature = "header-value")]
1516+
#[cfg(feature = "strict-header-value")]
15171517
#[cfg(nightly)]
15181518
#[bench]
15191519
fn bench_deserialize_map(b: &mut Bencher) {
@@ -1523,7 +1523,7 @@ mod utils {
15231523
});
15241524
}
15251525

1526-
#[cfg(not(feature = "header-value"))]
1526+
#[cfg(not(feature = "strict-header-value"))]
15271527
#[cfg(nightly)]
15281528
#[bench]
15291529
fn bench_deserialize_map(b: &mut Bencher) {

0 commit comments

Comments
 (0)