From 4795e831bb414fc5059f5f3b3e35e50ce09564e5 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Wed, 26 Jul 2023 08:50:34 -0700 Subject: [PATCH] Address comments --- bindings/wasm/output.go | 3 +++ bindings/wasm/testdata/http/Makefile | 4 ++++ bindings/wasm/testdata/http/main.wasm | Bin 5726700 -> 5726767 bytes 3 files changed, 7 insertions(+) create mode 100644 bindings/wasm/testdata/http/Makefile mode change 100644 => 100755 bindings/wasm/testdata/http/main.wasm diff --git a/bindings/wasm/output.go b/bindings/wasm/output.go index 98e3369442..934a3f0f88 100644 --- a/bindings/wasm/output.go +++ b/bindings/wasm/output.go @@ -89,6 +89,9 @@ func (out *outputBinding) Init(ctx context.Context, metadata bindings.Metadata) return fmt.Errorf("wasm: error instantiating host wasi functions: %w", err) } if _, found := imports[modeWasiHTTP]; found { + if out.meta.StrictSandbox { + return fmt.Errorf("can not instantiate wasi-http with strict sandbox") + } err = wasi_http.Instantiate(ctx, out.runtime) } if err != nil { diff --git a/bindings/wasm/testdata/http/Makefile b/bindings/wasm/testdata/http/Makefile new file mode 100644 index 0000000000..f82b0ebfd6 --- /dev/null +++ b/bindings/wasm/testdata/http/Makefile @@ -0,0 +1,4 @@ +default: main.wasm + +main.wasm: main.go + tinygo build -target wasi -o main.wasm main.go \ No newline at end of file diff --git a/bindings/wasm/testdata/http/main.wasm b/bindings/wasm/testdata/http/main.wasm old mode 100644 new mode 100755 index cd07742e83ced1780f1bf857c58e03dd262fabcc..7d65972dd525e46a062b0457f393ade6e38355c4 GIT binary patch delta 2281 zcmb7^4QvzV8OQy+cjqKdh@B7TtNFUb=h)|qFHTCpX`F;EErEuFuK{Zzt@Axvn?T=D5T}16%yrX)s~KrOkJaiXqCEv1~gmOg^6lnDryUC?DbHl zX_!j0^t0}N|L6Yid(S<3ub;b2-a3DoY}Y^|8mIA^py{<3Emn)u3|hRFpe@i6HKS(I zlC)$kMN8GpTAG%wWoVgNmiCaAt>tLBTAr4FQaoL2`0|L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