🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

github.com/tetratelabs/proxy-wasm-go-sdk/examples/http_body

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/tetratelabs/proxy-wasm-go-sdk/examples/http_body

v0.0.0-20240727195906-33c01aaf132c
Source
Go
Version published
Created
Source

http_body

this example demonstrates how to perform operation on a request or response body like append/prepend/replace.

To modify the request:

$ curl -XPUT localhost:18000 --data '[initial body]' -H "buffer-operation: prepend"
[this is prepended body][initial body]

$ curl -XPUT localhost:18000 --data '[initial body]' -H "buffer-operation: append"
[initial body][this is appended body]

$ curl -XPUT localhost:18000 --data '[initial body]' -H "buffer-operation: replace"
[this is replaced body]

To modify the response:

$ curl -XPUT localhost:18000 --data '[initial body]' -H "buffer-operation: prepend" -H "buffer-replace-at: response"
[this is prepended body][initial body]

$ curl -XPUT localhost:18000 --data '[initial body]' -H "buffer-operation: append" -H "buffer-replace-at: response"
[initial body][this is appended body]

$ curl -XPUT localhost:18000 --data '[initial body]' -H "buffer-operation: replace" -H "buffer-replace-at: response"
[this is replaced body]

FAQs

Package last updated on 27 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts