{"action":"closed","issue":{"url":"https://api.github.com/repos/kraih/mojo/issues/1253","repository_url":"https://api.github.com/repos/kraih/mojo","labels_url":"https://api.github.com/repos/kraih/mojo/issues/1253/labels{/name}","comments_url":"https://api.github.com/repos/kraih/mojo/issues/1253/comments","events_url":"https://api.github.com/repos/kraih/mojo/issues/1253/events","html_url":"https://github.com/kraih/mojo/issues/1253","id":353275447,"node_id":"MDU6SXNzdWUzNTMyNzU0NDc=","number":1253,"title":"Content-type header on POST affected by regex capture group","user":{"login":"RastislavHudak","id":1140376,"node_id":"MDQ6VXNlcjExNDAzNzY=","avatar_url":"https://avatars0.githubusercontent.com/u/1140376?v=4","gravatar_id":"","url":"https://api.github.com/users/RastislavHudak","html_url":"https://github.com/RastislavHudak","followers_url":"https://api.github.com/users/RastislavHudak/followers","following_url":"https://api.github.com/users/RastislavHudak/following{/other_user}","gists_url":"https://api.github.com/users/RastislavHudak/gists{/gist_id}","starred_url":"https://api.github.com/users/RastislavHudak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RastislavHudak/subscriptions","organizations_url":"https://api.github.com/users/RastislavHudak/orgs","repos_url":"https://api.github.com/users/RastislavHudak/repos","events_url":"https://api.github.com/users/RastislavHudak/events{/privacy}","received_events_url":"https://api.github.com/users/RastislavHudak/received_events","type":"User","site_admin":false},"labels":[{"id":85884,"node_id":"MDU6TGFiZWw4NTg4NA==","url":"https://api.github.com/repos/kraih/mojo/labels/bug","name":"bug","color":"ff0000","default":true},{"id":289647972,"node_id":"MDU6TGFiZWwyODk2NDc5NzI=","url":"https://api.github.com/repos/kraih/mojo/labels/help%20wanted","name":"help wanted","color":"d4c5f9","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-23T08:25:34Z","updated_at":"2018-08-23T20:37:26Z","closed_at":"2018-08-23T20:37:26Z","author_association":"NONE","body":"* Mojolicious version: 7.93\r\n* Perl version: 5.26.1\r\n* Operating system: Ubuntu 16.04 LTS\r\n\r\n### Steps to reproduce the behavior\r\n\r\nMake a post request and use match with capture groups:\r\n\r\n```perl\r\n#!/usr/bin/env perl\r\n\r\nuse Mojo::UserAgent;\r\nuse Mojo::Asset::Memory;\r\n\r\nmy $mem = Mojo::Asset::Memory->new;\r\n$mem->add_chunk('foo bar baz');\r\n\r\nmy $v = 'allglorytothehypnotoad/weneedtheslashhere';\r\n\r\n$v =~ /(\\w+)\\/(\\w+)/;\r\n\r\nmy $ua = Mojo::UserAgent->new;\r\nprint $ua->post('http://127.0.0.1:3000' => {'Content-Type' => 'application/octet-stream'} => form => { file => { file => $mem } } )->result->body;\r\n\r\n1;\r\n```\r\nAnd use something to inspect the headers\r\n```perl\r\n#!/usr/bin/env perl\r\n\r\nuse Mojolicious::Lite -signatures;\r\n\r\npost '/'  => sub ($c) {\r\n  $c->render(text => $c->req->to_string);\r\n};\r\n\r\napp->start;\r\n```\r\n\r\n### Expected behavior\r\n\r\nHere how headers should look like.\r\n\r\n```\r\nPOST / HTTP/1.1\r\nUser-Agent: Mojolicious (Perl)\r\nContent-Length: 97\r\nAccept-Encoding: gzip\r\nContent-Type: multipart/mixed; boundary=CiVhX\r\nHost: 127.0.0.1:3000\r\n\r\n--CiVhX\r\nContent-Disposition: form-data; name=\"file\"; filename=\"file\"\r\n\r\nfoo bar baz\r\n--CiVhX--\r\n\r\n```\r\n\r\n### Actual behavior\r\n\r\nContent-type header gets scrambled by the match.\r\n\r\n```\r\nPOST / HTTP/1.1\r\nContent-Length: 97\r\nAccept-Encoding: gzip\r\nUser-Agent: Mojolicious (Perl)\r\nHost: 127.0.0.1:3000\r\nContent-Type: allglorytothehypnotoad; boundary=bsrSXweneedtheslashhere\r\n\r\n--YHo1X\r\nContent-Disposition: form-data; name=\"file\"; filename=\"file\"\r\n\r\nfoo bar baz\r\n--YHo1X--\r\n```\r\n"}}
{"actor":{"display_login":"kraih"}}