From 40f132b77b767604e8b8b875b6b32103c8c3930e Mon Sep 17 00:00:00 2001 From: jffarge Date: Fri, 22 Oct 2021 16:48:30 +0200 Subject: [PATCH] Execute os file before Atoi execution Signed-off-by: jffarge --- stdlib/http/http.cue | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/stdlib/http/http.cue b/stdlib/http/http.cue index c1d2f538..44e495db 100644 --- a/stdlib/http/http.cue +++ b/stdlib/http/http.cue @@ -2,6 +2,7 @@ package http import ( "encoding/json" + "strconv" "alpha.dagger.io/alpine" "alpha.dagger.io/dagger" @@ -64,18 +65,23 @@ import ( """# } + statusCode: { + os.#File & { + from: ctr + path: "/status" + } + }.contents @dagger(output) + + body: { + os.#File & { + from: ctr + path: "/response" + } + }.contents @dagger(output) + + // Force os.#File exec before Atoi response: { - body: { - os.#File & { - from: ctr - path: "/response" - } - }.contents @dagger(output) - statusCode: { - os.#File & { - from: ctr - path: "/status" - } - }.contents @dagger(output) + "body": body + "statusCode": strconv.Atoi(statusCode) } }