Fix post messages (now without verify that resource exists)

This commit is contained in:
g1n 2021-07-09 14:16:58 +00:00
parent 53d5817973
commit 037437207b
2 changed files with 5 additions and 5 deletions

View File

@ -19,11 +19,11 @@ usage() {
}
request(){
page=$(printf "$host /$path 0\r\n" | nc $host $port)
page=$(printf "$host /$path $post_len\r\n$post" | nc $host $port)
status=$(echo $page | awk 'NR == 1 {print $1}')
meta=$(echo $page | awk 'NR == 1 {$1=="";print}')
if [[ $status == 2 ]]; then
printf "$host /$path $post_len\r\n$post\r\n" | nc $host $port | awk 'NR > 1 {print}'
echo -e "$page\n" | awk 'NR > 1 {print}'
elif [[ $status == 3 ]]; then
#path=$meta
printf "%s %s %s\r\n%s\r\n" "$host" "/$path/" "$post_len" "$post" | nc $host $port | awk 'NR > 1 {print}'
@ -46,7 +46,7 @@ while getopts ":h:p:m:i:u:" arg; do
export post_len=$(echo $post | wc -c )
;;
m | --message)
export post=$( echo $OPTARG)
export post=$OPTARG
export post_len=$(echo $post | wc -c )
;;
u | --url)

View File

@ -1,2 +1,2 @@
2.One more test sorry
3.One more test sorry
-- g1n