mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 06:48:31 +00:00
Accept table arg in redbean Fetch() API (#218)
This commit is contained in:
parent
a73e808b25
commit
0b317523a0
2 changed files with 34 additions and 13 deletions
|
@ -20,10 +20,14 @@
|
|||
#include "net/http/http.h"
|
||||
|
||||
/**
|
||||
* Returns small number for HTTP method, or 0 if not found.
|
||||
* Converts HTTP method string into internal index
|
||||
*
|
||||
* @param len if -1 implies strlen
|
||||
* @return small number for HTTP method, or 0 if not found.
|
||||
*/
|
||||
int GetHttpMethod(const char *str, size_t len) {
|
||||
const struct HttpMethodSlot *slot;
|
||||
if (len == -1) len = str ? strlen(str) : 0;
|
||||
if ((slot = LookupHttpMethod(str, len))) {
|
||||
return slot->code;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue