Commit 5c3d63f0 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

Merge branch '73-fix-netcat-http-query' into 'master'

fix: remove extra '\n' in netcated HTTP query

Closes #73

See merge request to-be-continuous/terraform!109
parents 51261795 618b6b90
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -606,7 +606,7 @@ stages:
          host=$(echo "$host_port" | cut -d':' -f1)
          port=$(echo "$host_port" | cut -d':' -s -f2)
          subject=$(echo "$url" | cut -d'/' -f4-)
          cat <(echo -e "GET /${subject} HTTP/1.1\r\nHost: $host\r\n\r\n") <(sleep 1) | nc ${TRACE+-v} "$host" "${port:-80}" > "${output}"
          cat <(echo -ne "GET /${subject} HTTP/1.1\r\nHost: $host\r\n\r\n") <(sleep 1) | nc ${TRACE+-v} "$host" "${port:-80}" > "${output}"
          status_code=$(head -1 "${output}" | cut -d' ' -f2)
          status_message=$(head -1 "${output}" | cut -d' ' -f3-)
          awk 'NR==1,/^\r$/ {next} {printf "%s%s",$0,RT}' "${output}" > "${decoded}"