Permalink
Browse files

get_header_value detects case insensitive headers.

This function is used to parse headers. However, as stated in the
bug #403, headers can be sent in any case (upper, lower or camel).
Adding the **-i** flag to grep enables detection of any kind of
header.

Fixed #403.
  • Loading branch information...
1 parent f74a822 commit e9b6c9b1255ce7fe4e42484c8c2e5533df43bbbc Rodrigo Fuentealba Cartes committed Aug 5, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 core/functions
View
2 core/functions
@@ -317,7 +317,7 @@ get_status_code(){
# we may eventually use a specific header for Prey
get_header_value(){
- echo "$response_headers" | grep "$1" | tail -1 | sed 's/.*: \([a-z\/-]*\).*/\1/'
+ echo "$response_headers" | grep -i "$1" | tail -1 | sed 's/.*: \([a-z\/-]*\).*/\1/'
}
# fetches last response if online actions were enabled for the device

0 comments on commit e9b6c9b

Please sign in to comment.