Fix post messages (now without verify that resource exists)
This commit is contained in:
parent
53d5817973
commit
037437207b
8
laconia
8
laconia
|
@ -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,8 +46,8 @@ while getopts ":h:p:m:i:u:" arg; do
|
|||
export post_len=$(echo $post | wc -c )
|
||||
;;
|
||||
m | --message)
|
||||
export post=$( echo $OPTARG)
|
||||
export post_len=$( echo $post | wc -c )
|
||||
export post=$OPTARG
|
||||
export post_len=$(echo $post | wc -c )
|
||||
;;
|
||||
u | --url)
|
||||
url_unparsed=$OPTARG
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
2.One more test sorry
|
||||
3.One more test sorry
|
||||
-- g1n
|
||||
|
|
Loading…
Reference in New Issue