-
Notifications
You must be signed in to change notification settings - Fork 5.3k
filters: add generic compressor filter #7057
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
Changes from all commits
321d72e
86d8f82
fd920c4
6a1f90f
207d983
eeb4c4f
054be50
1a8853b
5124466
0405f89
ae31978
c05bcbd
a239574
6a373cd
07b4974
d27b53e
36cd2d3
a71137c
a8c86ef
7cbdadd
19a2cfa
f7960f9
5942a8e
12e6281
bf2710a
bb5b24b
a6c6c46
3164191
ff14601
134187b
a8522dd
decc691
ffbd399
b961274
e7a928f
59db2c2
dec3407
f376068
2a9a12a
9f389b0
ce23b42
676d676
c68e451
1e6f7bf
5f9d88d
e8bab57
edaecd2
96dc9d4
dd64763
1f3aa75
5296095
e7c5fc0
98533ba
b034b87
8693478
0e8656f
93ebd44
41f9843
859bb4c
f408dc6
bed9247
da69508
09d0ca8
afa48c6
54b47e9
8ceb6d8
dbc2e91
adb9ce6
9ea11ca
6b98708
d7bd763
9fe7a41
e99b4c1
8b1ff4e
0b38c92
4cb988e
ad73448
2bbbeb2
ee50131
d414cb8
3d50681
3d6bbb5
0df08ac
3d8d556
68e3a60
1264376
4461a7a
6b3a23e
1f89041
4a70888
50e7300
31324f2
70ef5fc
d2c385d
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 |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # DO NOT EDIT. This file is generated by tools/proto_sync.py. | ||
|
|
||
| load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") | ||
|
|
||
| licenses(["notice"]) # Apache 2 | ||
|
|
||
| api_proto_package( | ||
| deps = [ | ||
| "//envoy/api/v2/core:pkg", | ||
| "@com_github_cncf_udpa//udpa/annotations:pkg", | ||
| ], | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package envoy.config.filter.http.compressor.v2; | ||
|
|
||
| import "envoy/api/v2/core/base.proto"; | ||
|
|
||
| import "google/protobuf/wrappers.proto"; | ||
|
|
||
| import "udpa/annotations/migrate.proto"; | ||
|
|
||
| option java_package = "io.envoyproxy.envoy.config.filter.http.compressor.v2"; | ||
| option java_outer_classname = "CompressorProto"; | ||
| option java_multiple_files = true; | ||
| option (udpa.annotations.file_migrate).move_to_package = | ||
| "envoy.extensions.filters.http.compressor.v3"; | ||
|
|
||
| // [#protodoc-title: Compressor] | ||
|
|
||
| // [#next-free-field: 6] | ||
| message Compressor { | ||
| // Minimum response length, in bytes, which will trigger compression. The default value is 30. | ||
| google.protobuf.UInt32Value content_length = 1; | ||
|
|
||
| // Set of strings that allows specifying which mime-types yield compression; e.g., | ||
| // application/json, text/html, etc. When this field is not defined, compression will be applied | ||
| // to the following mime-types: "application/javascript", "application/json", | ||
mattklein123 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // "application/xhtml+xml", "image/svg+xml", "text/css", "text/html", "text/plain", "text/xml" | ||
| // and their synonyms. | ||
| repeated string content_type = 2; | ||
|
|
||
| // If true, disables compression when the response contains an etag header. When it is false, the | ||
| // filter will preserve weak etags and remove the ones that require strong validation. | ||
| bool disable_on_etag_header = 3; | ||
|
|
||
| // If true, removes accept-encoding from the request headers before dispatching it to the upstream | ||
| // so that responses do not get compressed before reaching the filter. | ||
| // .. attention: | ||
| // | ||
| // To avoid interfering with other compression filters in the same chain use this option in | ||
| // the filter closest to the upstream. | ||
| bool remove_accept_encoding_header = 4; | ||
|
|
||
| // Runtime flag that controls whether the filter is enabled or not. If set to false, the | ||
| // filter will operate as a pass-through filter. If not specified, defaults to enabled. | ||
| api.v2.core.RuntimeFeatureFlag runtime_enabled = 5; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # DO NOT EDIT. This file is generated by tools/proto_sync.py. | ||
|
|
||
| load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") | ||
|
|
||
| licenses(["notice"]) # Apache 2 | ||
|
|
||
| api_proto_package( | ||
| deps = [ | ||
| "//envoy/config/core/v3:pkg", | ||
| "//envoy/config/filter/http/compressor/v2:pkg", | ||
| "@com_github_cncf_udpa//udpa/annotations:pkg", | ||
| ], | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package envoy.extensions.filters.http.compressor.v3; | ||
|
|
||
| import "envoy/config/core/v3/base.proto"; | ||
|
|
||
| import "google/protobuf/wrappers.proto"; | ||
|
|
||
| import "udpa/annotations/versioning.proto"; | ||
|
|
||
| option java_package = "io.envoyproxy.envoy.extensions.filters.http.compressor.v3"; | ||
| option java_outer_classname = "CompressorProto"; | ||
| option java_multiple_files = true; | ||
|
|
||
| // [#protodoc-title: Compressor] | ||
|
|
||
| // [#next-free-field: 6] | ||
| message Compressor { | ||
| option (udpa.annotations.versioning).previous_message_type = | ||
| "envoy.config.filter.http.compressor.v2.Compressor"; | ||
|
|
||
| // Minimum response length, in bytes, which will trigger compression. The default value is 30. | ||
| google.protobuf.UInt32Value content_length = 1; | ||
|
|
||
| // Set of strings that allows specifying which mime-types yield compression; e.g., | ||
| // application/json, text/html, etc. When this field is not defined, compression will be applied | ||
| // to the following mime-types: "application/javascript", "application/json", | ||
| // "application/xhtml+xml", "image/svg+xml", "text/css", "text/html", "text/plain", "text/xml" | ||
| // and their synonyms. | ||
| repeated string content_type = 2; | ||
|
|
||
| // If true, disables compression when the response contains an etag header. When it is false, the | ||
| // filter will preserve weak etags and remove the ones that require strong validation. | ||
| bool disable_on_etag_header = 3; | ||
|
|
||
| // If true, removes accept-encoding from the request headers before dispatching it to the upstream | ||
| // so that responses do not get compressed before reaching the filter. | ||
| // .. attention: | ||
| // | ||
| // To avoid interfering with other compression filters in the same chain use this option in | ||
| // the filter closest to the upstream. | ||
| bool remove_accept_encoding_header = 4; | ||
|
|
||
| // Runtime flag that controls whether the filter is enabled or not. If set to false, the | ||
| // filter will operate as a pass-through filter. If not specified, defaults to enabled. | ||
| config.core.v3.RuntimeFeatureFlag runtime_enabled = 5; | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| licenses(["notice"]) # Apache 2 | ||
|
|
||
| load( | ||
| "//bazel:envoy_build_system.bzl", | ||
| "envoy_cc_library", | ||
| "envoy_package", | ||
| ) | ||
|
|
||
| envoy_package() | ||
|
|
||
| envoy_cc_library( | ||
| name = "compressor_lib", | ||
| srcs = ["compressor.cc"], | ||
| hdrs = ["compressor.h"], | ||
| deps = [ | ||
| "//include/envoy/compressor:compressor_interface", | ||
| "//include/envoy/stats:stats_macros", | ||
| "//include/envoy/stream_info:filter_state_interface", | ||
| "//source/common/buffer:buffer_lib", | ||
| "//source/common/http:header_map_lib", | ||
| "//source/common/protobuf", | ||
| "//source/common/runtime:runtime_lib", | ||
| "//source/extensions/filters/http/common:pass_through_filter_lib", | ||
| "@envoy_api//envoy/extensions/filters/http/compressor/v3:pkg_cc_proto", | ||
| ], | ||
| ) |
Uh oh!
There was an error while loading. Please reload this page.