diff --git a/command/v7/curl_command.go b/command/v7/curl_command.go index 7afc327e37..98ede4ded9 100644 --- a/command/v7/curl_command.go +++ b/command/v7/curl_command.go @@ -69,7 +69,7 @@ func (cmd CurlCommand) Execute(args []string) error { } cmd.UI.GetOut().Write(responseBodyBytes) } else { - cmd.UI.DisplayText(string(bytesToWrite)) + cmd.UI.DisplayTextLiteral(string(bytesToWrite)) } return nil diff --git a/command/v7/curl_command_test.go b/command/v7/curl_command_test.go index 561259997a..86a19aa24b 100644 --- a/command/v7/curl_command_test.go +++ b/command/v7/curl_command_test.go @@ -97,6 +97,17 @@ var _ = Describe("curl Command", func() { Expect(testUI.Out).To(Say("sarah, teal, and reid were here")) }) + When("the request contains double curly braces", func() { + BeforeEach(func() { + fakeActor.MakeCurlRequestReturns([]byte("{{ }}"), &http.Response{}, nil) + }) + + It("returns the literal text", func() { + Expect(executeErr).NotTo(HaveOccurred()) + Expect(testUI.Out).To(Say("{{ }}")) + }) + }) + When("the request errors", func() { BeforeEach(func() { fakeActor.MakeCurlRequestReturns([]byte{}, &http.Response{}, errors.New("this sucks"))