-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use RFC-compliant HeaderValue type. #287
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,15 @@ edition = "2018" | |
build = "build.rs" | ||
|
||
[dependencies] | ||
bytes = { version = "1", optional = true } | ||
hashbrown = "0.15" | ||
http = { version = "1", optional = true } | ||
log = "0.4" | ||
|
||
[features] | ||
default = [] | ||
header-value = ["dep:bytes", "dep:http"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feature could be renamed to Alternatively, we could drop this as a feature and instead add those functions as variants with Thoughts? |
||
|
||
[profile.release] | ||
lto = true | ||
opt-level = 3 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,13 @@ | |
[license-badge]: https://img.shields.io/github/license/proxy-wasm/proxy-wasm-rust-sdk | ||
[license-link]: https://github.com/proxy-wasm/proxy-wasm-rust-sdk/blob/main/LICENSE | ||
|
||
## Crate features | ||
|
||
This crate supports the following optional features: | ||
|
||
- `header-value` - uses RFC-compliant `HeaderValue` instead of UTF-8 `String` for HTTP header and trailer values. | ||
This will become the default in future releases. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that this PR doesn't introduce any changes or restrictions on header names in the SDK, since all valid HTTP field names are also valid UTF-8 strings, and proxies are very strict about this, so we never panic deserializing header names. Having said that, I'm tempted to use Unfortunately, because we're passing HTTP/2 pseudo-headers (
|
||
|
||
## Examples | ||
|
||
- [Hello World](./examples/hello_world/) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
############################################################################### | ||
# @generated | ||
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To | ||
# regenerate this file, run the following: | ||
# | ||
# bazel run @//bazel/cargo:crates_vendor | ||
############################################################################### | ||
|
||
load("@rules_rust//rust:defs.bzl", "rust_library") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
rust_library( | ||
name = "bytes", | ||
srcs = glob( | ||
include = ["**/*.rs"], | ||
allow_empty = True, | ||
), | ||
compile_data = glob( | ||
include = ["**"], | ||
allow_empty = True, | ||
exclude = [ | ||
"**/* *", | ||
".tmp_git_root/**/*", | ||
"BUILD", | ||
"BUILD.bazel", | ||
"WORKSPACE", | ||
"WORKSPACE.bazel", | ||
], | ||
), | ||
crate_features = [ | ||
"default", | ||
"std", | ||
], | ||
crate_root = "src/lib.rs", | ||
edition = "2018", | ||
rustc_flags = [ | ||
"--cap-lints=allow", | ||
], | ||
tags = [ | ||
"cargo-bazel", | ||
"crate-name=bytes", | ||
"manual", | ||
"noclippy", | ||
"norustfmt", | ||
], | ||
target_compatible_with = select({ | ||
"@rules_rust//rust/platform:aarch64-apple-darwin": [], | ||
"@rules_rust//rust/platform:aarch64-apple-ios": [], | ||
"@rules_rust//rust/platform:aarch64-apple-ios-sim": [], | ||
"@rules_rust//rust/platform:aarch64-fuchsia": [], | ||
"@rules_rust//rust/platform:aarch64-linux-android": [], | ||
"@rules_rust//rust/platform:aarch64-pc-windows-msvc": [], | ||
"@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [], | ||
"@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [], | ||
"@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [], | ||
"@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [], | ||
"@rules_rust//rust/platform:armv7-linux-androideabi": [], | ||
"@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [], | ||
"@rules_rust//rust/platform:i686-apple-darwin": [], | ||
"@rules_rust//rust/platform:i686-linux-android": [], | ||
"@rules_rust//rust/platform:i686-pc-windows-msvc": [], | ||
"@rules_rust//rust/platform:i686-unknown-freebsd": [], | ||
"@rules_rust//rust/platform:i686-unknown-linux-gnu": [], | ||
"@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [], | ||
"@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [], | ||
"@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [], | ||
"@rules_rust//rust/platform:s390x-unknown-linux-gnu": [], | ||
"@rules_rust//rust/platform:thumbv7em-none-eabi": [], | ||
"@rules_rust//rust/platform:thumbv8m.main-none-eabi": [], | ||
"@rules_rust//rust/platform:wasm32-unknown-unknown": [], | ||
"@rules_rust//rust/platform:wasm32-wasi": [], | ||
"@rules_rust//rust/platform:x86_64-apple-darwin": [], | ||
"@rules_rust//rust/platform:x86_64-apple-ios": [], | ||
"@rules_rust//rust/platform:x86_64-fuchsia": [], | ||
"@rules_rust//rust/platform:x86_64-linux-android": [], | ||
"@rules_rust//rust/platform:x86_64-pc-windows-msvc": [], | ||
"@rules_rust//rust/platform:x86_64-unknown-freebsd": [], | ||
"@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [], | ||
"@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [], | ||
"@rules_rust//rust/platform:x86_64-unknown-none": [], | ||
"//conditions:default": ["@platforms//:incompatible"], | ||
}), | ||
version = "1.8.0", | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
############################################################################### | ||
# @generated | ||
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To | ||
# regenerate this file, run the following: | ||
# | ||
# bazel run @//bazel/cargo:crates_vendor | ||
############################################################################### | ||
|
||
load("@rules_rust//rust:defs.bzl", "rust_library") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
rust_library( | ||
name = "fnv", | ||
srcs = glob( | ||
include = ["**/*.rs"], | ||
allow_empty = True, | ||
), | ||
compile_data = glob( | ||
include = ["**"], | ||
allow_empty = True, | ||
exclude = [ | ||
"**/* *", | ||
".tmp_git_root/**/*", | ||
"BUILD", | ||
"BUILD.bazel", | ||
"WORKSPACE", | ||
"WORKSPACE.bazel", | ||
], | ||
), | ||
crate_features = [ | ||
"default", | ||
"std", | ||
], | ||
crate_root = "lib.rs", | ||
edition = "2015", | ||
rustc_flags = [ | ||
"--cap-lints=allow", | ||
], | ||
tags = [ | ||
"cargo-bazel", | ||
"crate-name=fnv", | ||
"manual", | ||
"noclippy", | ||
"norustfmt", | ||
], | ||
target_compatible_with = select({ | ||
"@rules_rust//rust/platform:aarch64-apple-darwin": [], | ||
"@rules_rust//rust/platform:aarch64-apple-ios": [], | ||
"@rules_rust//rust/platform:aarch64-apple-ios-sim": [], | ||
"@rules_rust//rust/platform:aarch64-fuchsia": [], | ||
"@rules_rust//rust/platform:aarch64-linux-android": [], | ||
"@rules_rust//rust/platform:aarch64-pc-windows-msvc": [], | ||
"@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [], | ||
"@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [], | ||
"@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [], | ||
"@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [], | ||
"@rules_rust//rust/platform:armv7-linux-androideabi": [], | ||
"@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [], | ||
"@rules_rust//rust/platform:i686-apple-darwin": [], | ||
"@rules_rust//rust/platform:i686-linux-android": [], | ||
"@rules_rust//rust/platform:i686-pc-windows-msvc": [], | ||
"@rules_rust//rust/platform:i686-unknown-freebsd": [], | ||
"@rules_rust//rust/platform:i686-unknown-linux-gnu": [], | ||
"@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [], | ||
"@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [], | ||
"@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [], | ||
"@rules_rust//rust/platform:s390x-unknown-linux-gnu": [], | ||
"@rules_rust//rust/platform:thumbv7em-none-eabi": [], | ||
"@rules_rust//rust/platform:thumbv8m.main-none-eabi": [], | ||
"@rules_rust//rust/platform:wasm32-unknown-unknown": [], | ||
"@rules_rust//rust/platform:wasm32-wasi": [], | ||
"@rules_rust//rust/platform:x86_64-apple-darwin": [], | ||
"@rules_rust//rust/platform:x86_64-apple-ios": [], | ||
"@rules_rust//rust/platform:x86_64-fuchsia": [], | ||
"@rules_rust//rust/platform:x86_64-linux-android": [], | ||
"@rules_rust//rust/platform:x86_64-pc-windows-msvc": [], | ||
"@rules_rust//rust/platform:x86_64-unknown-freebsd": [], | ||
"@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [], | ||
"@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [], | ||
"@rules_rust//rust/platform:x86_64-unknown-none": [], | ||
"//conditions:default": ["@platforms//:incompatible"], | ||
}), | ||
version = "1.0.7", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to myself: add
cargo test
andcargo bench
with--features header-value
if merged after #283.