Skip to content

Commit

Permalink
fix: multipart bodies
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Feb 6, 2025
1 parent c53b70f commit 3f879e5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/nasty-students-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"api-tuner": patch
---

Multipart `tuner:body` was not always correctly matched
2 changes: 2 additions & 0 deletions d98e5420-ebc2-42eb-b8f3-61bd5bca2ca1.curl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{ "response": {"certs":"","conn_id":0,"content_type":null,"errormsg":"Failed to connect to localhost port 1080 after 0 ms: Could not connect to server","exitcode":7,"filename_effective":"d98e5420-ebc2-42eb-b8f3-61bd5bca2ca1","ftp_entry_path":null,"http_code":0,"http_connect":0,"http_version":"0","local_ip":"","local_port":-1,"method":"GET","num_certs":0,"num_connects":0,"num_headers":0,"num_redirects":0,"num_retries":0,"proxy_ssl_verify_result":0,"proxy_used":0,"redirect_url":null,"referer":null,"remote_ip":"","remote_port":-1,"response_code":0,"scheme":"http","size_download":0,"size_header":0,"size_request":0,"size_upload":0,"speed_download":0,"speed_upload":0,"ssl_verify_result":0,"time_appconnect":0.000000,"time_connect":0.000000,"time_namelookup":0.000022,"time_posttransfer":0.000000,"time_pretransfer":0.000000,"time_redirect":0.000000,"time_starttransfer":0.000000,"time_total":0.000191,"url":"http://localhost:1080/example.com","url.fragment":null,"url.host":"localhost","url.options":null,"url.password":null,"url.path":"/example.com","url.port":"1080","url.query":null,"url.scheme":"http","url.user":null,"url.zoneid":null,"url_effective":"http://localhost:1080/example.com","urle.fragment":null,"urle.host":"localhost","urle.options":null,"urle.password":null,"urle.path":"/example.com","urle.port":"1080","urle.query":null,"urle.scheme":"http","urle.user":null,"urle.zoneid":null,"urlnum":0,"xfer_id":0,"curl_version":"libcurl/8.11.0 OpenSSL/3.4.0 (SecureTransport) zlib/1.2.12 brotli/1.1.0 zstd/1.5.6 AppleIDN libssh2/1.11.1 nghttp2/1.64.0 librtmp/2.3"}, "headers": {
}}
3 changes: 2 additions & 1 deletion rules/curl-body.n3
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PREFIX string: <http://www.w3.org/2000/10/swap/string#>
PREFIX log: <http://www.w3.org/2000/10/swap/log#>
prefix file: <http://www.w3.org/2000/10/swap/file#>
prefix e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>
prefix math: <http://www.w3.org/2000/10/swap/math#>

{
?body </#body> ( ?curlArgs ?requestBodyFile ) .
Expand Down Expand Up @@ -32,7 +33,7 @@ prefix e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>
{
?multipartBody </#body> ( ?curlArgs [] ) .
} <= {
?multipartBody!log:rawType list:in ( log:LabeledBlankNode log:UnlabeledBlankNode ) .
?multipartBody!tuner:form!list:length math:greaterThan 0 .

(
?formField
Expand Down

0 comments on commit 3f879e5

Please sign in to comment.