switch (wsi->u.hdr.parser_state) {
case WSI_TOKEN_GET_URI:
case WSI_TOKEN_POST_URI:
+ case WSI_TOKEN_OPTIONS_URI:
case WSI_TOKEN_HOST:
case WSI_TOKEN_CONNECTION:
case WSI_TOKEN_KEY1:
wsi->u.hdr.parser_state]].len && c == ' ')
break;
- if ((wsi->u.hdr.parser_state != WSI_TOKEN_GET_URI) && (wsi->u.hdr.parser_state != WSI_TOKEN_POST_URI))
+ if ((wsi->u.hdr.parser_state != WSI_TOKEN_GET_URI) &&
+ (wsi->u.hdr.parser_state != WSI_TOKEN_POST_URI) &&
+ (wsi->u.hdr.parser_state != WSI_TOKEN_OPTIONS_URI))
goto check_eol;
/* special URI processing... end at space */
if (wsi->u.hdr.lextable_pos < 0) {
/* this is not a header we know about */
- if (wsi->u.hdr.ah->frag_index[WSI_TOKEN_GET_URI] || wsi->u.hdr.ah->frag_index[WSI_TOKEN_POST_URI] ||
- wsi->u.hdr.ah->frag_index[WSI_TOKEN_HTTP]) {
+ if (wsi->u.hdr.ah->frag_index[WSI_TOKEN_GET_URI] ||
+ wsi->u.hdr.ah->frag_index[WSI_TOKEN_POST_URI] ||
+ wsi->u.hdr.ah->frag_index[WSI_TOKEN_OPTIONS_URI] ||
+ wsi->u.hdr.ah->frag_index[WSI_TOKEN_HTTP]) {
/*
* altready had the method, no idea what
* this crap is, ignore
wsi->u.hdr.ah->frag_index[WSI_TOKEN_POST_URI]) {
lwsl_warn("Duplicated POST\n");
return -1;
+ } else if (n == WSI_TOKEN_OPTIONS_URI &&
+ wsi->u.hdr.ah->frag_index[WSI_TOKEN_OPTIONS_URI]) {
+ lwsl_warn("Duplicated OPTIONS\n");
+ return -1;
}
/*