Bug/Misbehave in HttpHeader.spin W5100/W5200
msrobots
Posts: 3,709
The Tokenizer of HttpHeader.spin is to rigorous.
The value / is allowed in url-parameter.
some things need to change (its easy)
locate
locate
locate
This will allow '/' inside of url-params and also allows files without extension and directories with extension (both problematic before)
the returned filename now includes the path as expected by the sd-driver
Enjoy!
Mike
The value / is allowed in url-parameter.
some things need to change (its easy)
locate
PRI IsStatusLineToken(value) return lookdown(value & $FF: "/", "?", "=", "+", " ", "&")replace with
PRI IsStatusLineToken(value) return lookdown(value & $FF: "?", "=", "+", " ", "&")
locate
PUB GetFileName | i, j repeat i from 1 to sectionTokenCnt[STATUS_LINE]-2 t1 := tokenPtr[i] repeat j from 0 to strsize(t1)-1 if(byte[t1][j] == ".") return tokenPtr[i] return @indexreplace with
PUB GetFileName return tokenPtr[1]
locate
PRI _GetFileNameExtension | I, j repeat i from 1 to sectionTokenCnt[STATUS_LINE]-2 t1 := tokenPtr[i] repeat j from 0 to strsize(t1)-1 if(byte[t1][j] == ".") return tokenPtr[i]+j+1 return @index + strsize(@index)-FILE_EXTENSION_LENreplace with
PRI _GetFileNameExtension | j t1 := tokenPtr[1] repeat j from strsize(t1)-6 to strsize(t1)-1 if(byte[t1][j] == ".") return tokenPtr[1]+j+1 return @index + strsize(@index)-FILE_EXTENSION_LEN
This will allow '/' inside of url-params and also allows files without extension and directories with extension (both problematic before)
the returned filename now includes the path as expected by the sd-driver
Enjoy!
Mike