diff --git a/libretro-common/include/net/net_http.h b/libretro-common/include/net/net_http.h index ded3b091a0..4b376653c3 100644 --- a/libretro-common/include/net/net_http.h +++ b/libretro-common/include/net/net_http.h @@ -46,6 +46,8 @@ void net_http_connection_set_user_agent(struct http_connection_t* conn, const ch const char *net_http_connection_url(struct http_connection_t *conn); +const char* net_http_connection_method(struct http_connection_t* conn); + struct http_t *net_http_new(struct http_connection_t *conn); /* You can use this to call net_http_update diff --git a/libretro-common/net/net_http.c b/libretro-common/net/net_http.c index 33ac59dc2d..7cf8e527f3 100644 --- a/libretro-common/net/net_http.c +++ b/libretro-common/net/net_http.c @@ -682,6 +682,11 @@ const char *net_http_connection_url(struct http_connection_t *conn) return conn->urlcopy; } +const char* net_http_connection_method(struct http_connection_t* conn) +{ + return conn->methodcopy; +} + struct http_t *net_http_new(struct http_connection_t *conn) { bool error = false; diff --git a/tasks/task_http.c b/tasks/task_http.c index 164ec350d9..f1040bf48f 100644 --- a/tasks/task_http.c +++ b/tasks/task_http.c @@ -282,11 +282,13 @@ static void* task_push_http_transfer_generic( { retro_task_t *t = NULL; http_handle_t *http = NULL; + const char *method = NULL; if (!conn) return NULL; - if (conn->methodcopy && (conn->methodcopy[0] == 'P' || conn->methodcopy[0] == 'p')) + method = net_http_connection_method(conn); + if (method && (method[0] == 'P' || method[0] == 'p')) { /* POST requests usually mutate the server, so assume multiple calls are * intended, even if they're duplicated. Additionally, they may differ