-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: Add sample for blocking a request with particular header. #8
base: main
Are you sure you want to change the base?
Conversation
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
/assign @wsh |
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.
Approved pending confirmation from @mpwarres that StopAllIterationAndWatermark is the desired return value for a plugin that calls sendLocalResponse.
Thanks for sending this PR!
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.
Thanks for contributing! A few nits but otherwise LGTM
// limitations under the License. | ||
|
||
#include "proxy_wasm_intrinsics.h" | ||
#include <regex> |
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.
nit: unused
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// [START serviceextensions_example_block_request] |
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.
nit: remove _example fragment from name, here and below
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "proxy_wasm_intrinsics.h" |
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.
Repeat [START] and [END] tags in the C++ sample
@@ -30,6 +30,8 @@ plugin. Extend them to fit your particular use case. | |||
* [Add HTTP request & response headers](samples/add_header): Add a header on | |||
both the client request and server response paths. Also check for existing | |||
headers. | |||
* [Block Request with Particular Header Value](samples/block_request): Deny | |||
a request whenever it contains a paritcular header set to certain value. |
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.
nit: s/paritcular/particular
@nkllkc - Just a health check. This PR seems to have no recent updates. PTAL |
Add a sample that checks the client referer header for a bad value, serve a synthetic 404 block with a basic html response (error not found).