0 bytes returned - likely user error but....
Closed this issue ยท 19 comments
Describe the bug
I'm using a freepbx docker container, behind traefik, with a custom subdomain.
I have to use an addprefix middleware and a redirectregex middleware to make things work.
However, one page (call records) force inserts a URL into the HTML, which is gzip'd.
I have used your mw to rewrite this, but for some reason it causes no page to get returned at all :
(the login screen loads ok, but shows an error, and clicking the login button returns a 0 byte file).
Removing the mw results in things going back to how they were.
Relevant Config
Docker image : tiredofit/freepbx:latest
Impacting traefik labels:
traefik.enable | true
traefik.http.middlewares.mw_freepbxadmin.addprefix.prefix | /admin
traefik.http.middlewares.mw_freepbxucp.addprefix.prefix | /ucp
traefik.http.middlewares.mw_ucrpredirect.redirectregex.regex | ^https://MYDOMAIN/ucp
traefik.http.middlewares.mw_ucrpredirect.redirectregex.replacement | https://MYDOMAIN
traefik.http.routers.freepbxadmin.entryPoints | websecure
traefik.http.routers.freepbxadmin.middlewares | blockexternal@file,mw_ucrpredirect,mw_freepbxadmi
My rewrite plugin config in traefik.toml
[experimental.plugins]
[experimental.plugins.rewritebody]
moduleName = "github.com/packruler/rewrite-body"
version = "v0.5.0"
My dynamic traefik toml (@file) rules impacting this:
[http.middlewares.blockexternal]
[http.middlewares.blockexternal.ipWhitelist]
sourceRange = [ "10.74.0.0/16","172.17.0.0/16" ]
[http.middlewares.rewritezm.plugin.rewritebody]
#lastModified = true
[[http.middlewares.rewritezm.plugin.rewritebody.rewrites]]
regex="ZZZZ"
replacement="XXXX"
...the above should be nonimpacting as that ZZZZ will never occur.
Expected behavior
Stuff loads :)
Actual behavior
0 byte page returned.
Can jump on a share - this may well be something I'm doing, but I can see the content is text/html with gzip-encoding...
Logs
Debug enabled, I can't see anything which may be relevant re: an error, except that the middleware doesn't seem to get called?
time="2022-05-28T12:17:04+01:00" level=debug msg="Accept 10.74.10.1: &{Method:POST URL:/config.php Proto:HTTP/2.0 ProtoMajor:2 ProtoMinor:0 Header:map[Accept:[text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9] Accept-Encoding:[gzip, deflate, br] Accept-Language:[en-GB,en;q=0.9] Cache-Control:[max-age=0] Content-Length:[36] Content-Type:[application/x-www-form-urlencoded] Cookie:[lang=en_US; searchHide=1; PHPSESSID=gbr8md52jt3a97ajtqtvaguak3; _forward_auth_csrf_9ce202=9ce202229cf44a5dda374c0dc64ac605; _forward_auth_csrf_4eb47b=4eb47b97efeccc9af09a7deb97e61d03] Dnt:[1] Origin:[https://MYDOMAIN] Referer:[https://MYDOMAIN/config.php] Sec-Ch-Ua:[\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"101\", \"Google Chrome\";v=\"101\"] Sec-Ch-Ua-Mobile:[?0] Sec-Ch-Ua-Platform:[\"Windows\"] Sec-Fetch-Dest:[document] Sec-Fetch-Mode:[navigate] Sec-Fetch-Site:[same-origin] Sec-Fetch-User:[?1] Sec-Gpc:[1] Upgrade-Insecure-Requests:[1] User-Agent:[Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36] X-Forwarded-Host:[MYDOMAIN] X-Forwarded-Port:[443] X-Forwarded-Proto:[https] X-Forwarded-Server:[traefik] X-Real-Ip:[10.74.10.1]] Body:0xc000aa7a88 GetBody:<nil> ContentLength:36 TransferEncoding:[] Close:false Host:MYDOMAIN Form:map[] PostForm:map[] MultipartForm:<nil> Trailer:map[] RemoteAddr:10.74.10.1:2440 RequestURI:/config.php TLS:0xc0008cebb0 Cancel:<nil> Response:<nil> ctx:0xc000c010e0}" middlewareName=internal-only-ip@file middlewareType=IPWhiteLister
time="2022-05-28T12:17:04+01:00" level=debug msg="URL.Path is now /admin/config.php (was /config.php)." middlewareName=mw_freepbxadmin@docker middlewareType=AddPrefix
No reference to rewritebody appears, but no page is returned.
Removing rewritezm middleware from the label and stuff loads :\
Server (please complete the following information):
Debian (OpenMediaVault 5)
Traefik 2.6.6
Your pluging 0.5.0 (see toml)
Additional context
Add any other context about the problem here.
I may need to add some more logging so we can get to the root of this issue. ๐
I am curious about what the intended purpose of the rewrite is. It looks like you are rewriting URL references that start with https://MYDOMAIN/ucp
to start with https://MYDOMAIN
. To be clear this will not do any redirecting, only update links to aim at the root domain rather than content in the /ucp
path.
For example:
<a href="https://MYDOMAIN/ucp/some_page.html">Some Link</a>
becomes <a href="https://MYDOMAIN/some_page.html">Some Link</a>
Is this what is expected to function?
Also I see the call to /config.php
in your logs is a POST
call. POST
calls are currently ignored by this plugin but could be supported if needed. That said, I see there is the body of the request and the response are both nil
.
I will see about adding some improved logging so we can hopefully dig into this issue with a bit more context.
I just pushed an update that increases logging. Please update your plugin version to v1.0.1
and your middleware config to include logLevel: 1
and check logs again.
Ok, I switched to v1.0.1 and enabled logLevel = "1"
It's now not dying with 0 byte files, but test strings on my desired page aren't changing. Logs show I'm getting these:
Rewrite-Body | DEBUG2022/05/29 16:51:08 restricted.go:50: Ignoring unsupported request: &{POST /admin/ajax.php?command=navbarToogle HTTP/2.0 2 0 map[Accept:[application/json, text/javascript, */*; q=0.01] Accept-Encoding:[gzip, deflate, br] Accept-Language:[en-GB,en;q=0.9] Content-Length:[0] Cookie:[lang=en_US; searchHide=1; PHPSESSID=gbr8md52jt3a97ajtqtvaguak3] Dnt:[1] Origin:[https://MYDOMAIN] Referer:[https://MYDOMAIN/config.php?display=cdr] Sec-Ch-Ua:[" Not A;Brand";v="99", "Chromium";v="101", "Google Chrome";v="101"] Sec-Ch-Ua-Mobile:[?0] Sec-Ch-Ua-Platform:["Windows"] Sec-Fetch-Dest:[empty] Sec-Fetch-Mode:[cors] Sec-Fetch-Site:[same-origin] Sec-Gpc:[1] User-Agent:[Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36] X-Forwarded-Host:[MYDOMAIN] X-Forwarded-Port:[443] X-Forwarded-Proto:[https] X-Forwarded-Server:[traefik] X-Real-Ip:[10.74.10.1] X-Requested-With:[XMLHttpRequest]] 0xc0008109a8 <nil> 0 [] false MYDOMAIN map[] map[] <nil> map[] 10.74.10.1:2021 /admin/ajax.php?command=navbarToogle 0xc000d013f0 <nil> <nil> 0xc0004df0b0}
and:
Rewrite-Body | DEBUG2022/05/29 16:51:08 restricted.go:50: Starting supported request: &{GET /admin/ajax.php?module=search&command=global HTTP/2.0 2 0 map[Accept:[application/json, text/javascript, */*; q=0.01] Accept-Encoding:[gzip, deflate, br] Accept-Language:[en-GB,en;q=0.9] Cookie:[lang=en_US; searchHide=1; PHPSESSID=gbr8md52jt3a97ajtqtvaguak3] Dnt:[1] Referer:[https://MYDOMAIN/config.php?display=cdr] Sec-Ch-Ua:[" Not A;Brand";v="99", "Chromium";v="101", "Google Chrome";v="101"] Sec-Ch-Ua-Mobile:[?0] Sec-Ch-Ua-Platform:["Windows"] Sec-Fetch-Dest:[empty] Sec-Fetch-Mode:[cors] Sec-Fetch-Site:[same-origin] Sec-Gpc:[1] User-Agent:[Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36] X-Forwarded-Host:[MYDOMAIN] X-Forwarded-Port:[443] X-Forwarded-Proto:[https] X-Forwarded-Server:[traefik] X-Real-Ip:[10.74.10.1] X-Requested-With:[XMLHttpRequest]] 0xc000f843c0 <nil> 0 [] false MYDOMAIN map[] map[] <nil> map[] 10.74.10.1:2021 /admin/ajax.php?module=search&command=global 0xc000d013f0 <nil> <nil> 0xc0009cb230}
and, more oddly :
Rewrite-Body | DEBUG2022/05/29 16:51:08 restricted.go:50: Ignoring unsupported response: &{{[91 123 34 114 97 119 110 97 109 101 34 58 34 97 110 110 111 117 110 99 101 109 101 110 116 34 44 34 114 97 119 116 101 120 116 34 58 34 65 110 110 111 117 110 99 101 109 101 110 116 115 34 44 34 116 101 120 116 34 58 34 65 110 110 111 117 110 99 101 109 101 110 116 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 97 110 110 111 117 110 99 101 109 101 110 116 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 97 115 116 101 114 105 115 107 45 99 108 105 34 44 34 114 97 119 116 101 120 116 34 58 34 65 115 116 101 114 105 115 107 32 67 76 73 34 44 34 116 101 120 116 34 58 34 65 115 116 101 114 105 115 107 32 67 76 73 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 99 108 105 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 98 97 99 107 117 112 34 44 34 114 97 119 116 101 120 116 34 58 34 66 97 99 107 117 112 32 38 32 82 101 115 116 111 114 101 34 44 34 116 101 120 116 34 58 34 66 97 99 107 117 112 32 38 32 82 101 115 116 111 114 101 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 98 97 99 107 117 112 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 98 97 99 107 117 112 34 44 34 114 97 119 116 101 120 116 34 58 34 66 97 99 107 117 112 32 38 32 82 101 115 116 111 114 101 32 45 32 82 101 115 116 111 114 101 34 44 34 116 101 120 116 34 58 34 66 97 99 107 117 112 32 38 32 82 101 115 116 111 114 101 32 45 32 82 101 115 116 111 114 101 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 98 97 99 107 117 112 95 114 101 115 116 111 114 101 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 98 108 97 99 107 108 105 115 116 34 44 34 114 97 119 116 101 120 116 34 58 34 66 108 97 99 107 108 105 115 116 34 44 34 116 101 120 116 34 58 34 66 108 97 99 107 108 105 115 116 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 98 108 97 99 107 108 105 115 116 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 98 117 105 108 116 105 110 34 44 34 114 97 119 116 101 120 116 34 58 34 77 111 100 117 108 101 32 65 100 109 105 110 34 44 34 116 101 120 116 34 58 34 77 111 100 117 108 101 32 65 100 109 105 110 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 109 111 100 117 108 101 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 98 117 105 108 116 105 110 34 44 34 114 97 119 116 101 120 116 34 58 34 85 112 100 97 116 101 115 34 44 34 116 101 120 116 34 58 34 85 112 100 97 116 101 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 117 112 100 97 116 101 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 97 108 101 110 100 97 114 34 44 34 114 97 119 116 101 120 116 34 58 34 67 97 108 101 110 100 97 114 34 44 34 116 101 120 116 34 58 34 67 97 108 101 110 100 97 114 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 99 97 108 101 110 100 97 114 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 97 108 101 110 100 97 114 34 44 34 114 97 119 116 101 120 116 34 58 34 67 97 108 101 110 100 97 114 32 69 118 101 110 116 32 71 114 111 117 112 115 34 44 34 116 101 120 116 34 58 34 67 97 108 101 110 100 97 114 32 69 118 101 110 116 32 71 114 111 117 112 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 99 97 108 101 110 100 97 114 103 114 111 117 112 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 97 108 108 98 97 99 107 34 44 34 114 97 119 116 101 120 116 34 58 34 67 97 108 108 98 97 99 107 34 44 34 116 101 120 116 34 58 34 67 97 108 108 98 97 99 107 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 99 97 108 108 98 97 99 107 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 97 108 108 114 101 99 111 114 100 105 110 103 34 44 34 114 97 119 116 101 120 116 34 58 34 67 97 108 108 32 82 101 99 111 114 100 105 110 103 34 44 34 116 101 120 116 34 58 34 67 97 108 108 32 82 101 99 111 114 100 105 110 103 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 99 97 108 108 114 101 99 111 114 100 105 110 103 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 100 114 34 44 34 114 97 119 116 101 120 116 34 58 34 67 68 82 32 82 101 112 111 114 116 115 34 44 34 116 101 120 116 34 58 34 67 68 82 32 82 101 112 111 114 116 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 99 100 114 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 101 108 34 44 34 114 97 119 116 101 120 116 34 58 34 67 97 108 108 32 69 118 101 110 116 32 76 111 103 103 105 110 103 34 44 34 116 101 120 116 34 58 34 67 97 108 108 32 69 118 101 110 116 32 76 111 103 103 105 110 103 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 99 101 108 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 101 114 116 109 97 110 34 44 34 114 97 119 116 101 120 116 34 58 34 67 101 114 116 105 102 105 99 97 116 101 32 77 97 110 97 103 101 109 101 110 116 34 44 34 116 101 120 116 34 58 34 67 101 114 116 105 102 105 99 97 116 101 32 77 97 110 97 103 101 109 101 110 116 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 99 101 114 116 109 97 110 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 111 110 102 101 114 101 110 99 101 115 34 44 34 114 97 119 116 101 120 116 34 58 34 67 111 110 102 101 114 101 110 99 101 115 34 44 34 116 101 120 116 34 58 34 67 111 110 102 101 114 101 110 99 101 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 99 111 110 102 101 114 101 110 99 101 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 111 110 102 105 103 101 100 105 116 34 44 34 114 97 119 116 101 120 116 34 58 34 67 111 110 102 105 103 32 69 100 105 116 34 44 34 116 101 120 116 34 58 34 67 111 110 102 105 103 32 69 100 105 116 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 99 111 110 102 105 103 101 100 105 116 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 111 114 101 34 44 34 114 97 119 116 101 120 116 34 58 34 69 120 116 101 110 115 105 111 110 115 34 44 34 116 101 120 116 34 58 34 69 120 116 101 110 115 105 111 110 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 101 120 116 101 110 115 105 111 110 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 111 114 101 34 44 34 114 97 119 116 101 120 116 34 58 34 73 110 98 111 117 110 100 32 82 111 117 116 101 115 34 44 34 116 101 120 116 34 58 34 73 110 98 111 117 110 100 32 82 111 117 116 101 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 100 105 100 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 111 114 101 34 44 34 114 97 119 116 101 120 116 34 58 34 68 65 72 68 73 32 67 104 97 110 110 101 108 32 68 73 68 115 34 44 34 116 101 120 116 34 58 34 68 65 72 68 73 32 67 104 97 110 110 101 108 32 68 73 68 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 100 97 104 100 105 99 104 97 110 100 105 100 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 111 114 101 34 44 34 114 97 119 116 101 120 116 34 58 34 79 117 116 98 111 117 110 100 32 82 111 117 116 101 115 34 44 34 116 101 120 116 34 58 34 79 117 116 98 111 117 110 100 32 82 111 117 116 101 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 114 111 117 116 105 110 103 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 111 114 101 34 44 34 114 97 119 116 101 120 116 34 58 34 84 114 117 110 107 115 34 44 34 116 101 120 116 34 58 34 84 114 117 110 107 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 116 114 117 110 107 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 111 114 101 34 44 34 114 97 119 116 101 120 116 34 58 34 65 100 118 97 110 99 101 100 32 83 101 116 116 105 110 103 115 34 44 34 116 101 120 116 34 58 34 65 100 118 97 110 99 101 100 32 83 101 116 116 105 110 103 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 97 100 118 97 110 99 101 100 115 101 116 116 105 110 103 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 111 114 101 34 44 34 114 97 119 116 101 120 116 34 58 34 65 100 109 105 110 105 115 116 114 97 116 111 114 115 34 44 34 116 101 120 116 34 58 34 65 100 109 105 110 105 115 116 114 97 116 111 114 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 97 109 112 117 115 101 114 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 111 114 101 34 44 34 114 97 119 116 101 120 116 34 58 34 65 115 116 101 114 105 115 107 32 77 111 100 117 108 101 115 34 44 34 116 101 120 116 34 58 34 65 115 116 101 114 105 115 107 32 77 111 100 117 108 101 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 97 115 116 109 111 100 117 108 101 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 111 114 101 34 44 34 114 97 119 116 101 120 116 34 58 34 70 114 101 101 80 66 88 32 83 117 112 112 111 114 116 34 44 34 116 101 120 116 34 58 34 70 114 101 101 80 66 88 32 83 117 112 112 111 114 116 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 104 116 116 112 58 92 47 92 47 119 119 119 46 102 114 101 101 112 98 120 46 111 114 103 92 47 115 117 112 112 111 114 116 45 97 110 100 45 112 114 111 102 101 115 115 105 111 110 97 108 45 115 101 114 118 105 99 101 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 117 115 116 111 109 97 112 112 115 114 101 103 34 44 34 114 97 119 116 101 120 116 34 58 34 67 117 115 116 111 109 32 69 120 116 101 110 115 105 111 110 115 34 44 34 116 101 120 116 34 58 34 67 117 115 116 111 109 32 69 120 116 101 110 115 105 111 110 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 99 117 115 116 111 109 101 120 116 101 110 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 99 117 115 116 111 109 97 112 112 115 114 101 103 34 44 34 114 97 119 116 101 120 116 34 58 34 67 117 115 116 111 109 32 68 101 115 116 105 110 97 116 105 111 110 115 34 44 34 116 101 120 116 34 58 34 67 117 115 116 111 109 32 68 101 115 116 105 110 97 116 105 111 110 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 99 117 115 116 111 109 100 101 115 116 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 100 97 115 104 98 111 97 114 100 34 44 34 114 97 119 116 101 120 116 34 58 34 68 97 115 104 98 111 97 114 100 34 44 34 116 101 120 116 34 58 34 68 97 115 104 98 111 97 114 100 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 100 97 115 104 98 111 97 114 100 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 100 97 121 110 105 103 104 116 34 44 34 114 97 119 116 101 120 116 34 58 34 67 97 108 108 32 70 108 111 119 32 67 111 110 116 114 111 108 34 44 34 116 101 120 116 34 58 34 67 97 108 108 32 70 108 111 119 32 67 111 110 116 114 111 108 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 100 97 121 110 105 103 104 116 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 100 105 115 97 34 44 34 114 97 119 116 101 120 116 34 58 34 68 73 83 65 34 44 34 116 101 120 116 34 58 34 68 73 83 65 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 100 105 115 97 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 100 121 110 114 111 117 116 101 34 44 34 114 97 119 116 101 120 116 34 58 34 68 121 110 97 109 105 99 32 82 111 117 116 101 115 34 44 34 116 101 120 116 34 58 34 68 121 110 97 109 105 99 32 82 111 117 116 101 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 100 121 110 114 111 117 116 101 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 102 97 120 34 44 34 114 97 119 116 101 120 116 34 58 34 70 97 120 32 67 111 110 102 105 103 117 114 97 116 105 111 110 34 44 34 116 101 120 116 34 58 34 70 97 120 32 67 111 110 102 105 103 117 114 97 116 105 111 110 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 102 97 120 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 102 101 97 116 117 114 101 99 111 100 101 97 100 109 105 110 34 44 34 114 97 119 116 101 120 116 34 58 34 70 101 97 116 117 114 101 32 67 111 100 101 115 34 44 34 116 101 120 116 34 58 34 70 101 97 116 117 114 101 32 67 111 100 101 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 102 101 97 116 117 114 101 99 111 100 101 97 100 109 105 110 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 102 105 108 101 115 116 111 114 101 34 44 34 114 97 119 116 101 120 116 34 58 34 70 105 108 101 115 116 111 114 101 34 44 34 116 101 120 116 34 58 34 70 105 108 101 115 116 111 114 101 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 102 105 108 101 115 116 111 114 101 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 102 105 110 100 109 101 102 111 108 108 111 119 34 44 34 114 97 119 116 101 120 116 34 58 34 70 111 108 108 111 119 32 77 101 34 44 34 116 101 120 116 34 58 34 70 111 108 108 111 119 32 77 101 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 102 105 110 100 109 101 102 111 108 108 111 119 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 105 118 114 34 44 34 114 97 119 116 101 120 116 34 58 34 73 86 82 34 44 34 116 101 120 116 34 58 34 73 86 82 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 105 118 114 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 108 97 110 103 117 97 103 101 115 34 44 34 114 97 119 116 101 120 116 34 58 34 76 97 110 103 117 97 103 101 115 34 44 34 116 101 120 116 34 58 34 76 97 110 103 117 97 103 101 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 108 97 110 103 117 97 103 101 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 108 111 103 102 105 108 101 115 34 44 34 114 97 119 116 101 120 116 34 58 34 65 115 116 101 114 105 115 107 32 76 111 103 102 105 108 101 115 34 44 34 116 101 120 116 34 58 34 65 115 116 101 114 105 115 107 32 76 111 103 102 105 108 101 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 108 111 103 102 105 108 101 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 108 111 103 102 105 108 101 115 34 44 34 114 97 119 116 101 120 116 34 58 34 65 115 116 101 114 105 115 107 32 76 111 103 102 105 108 101 32 83 101 116 116 105 110 103 115 34 44 34 116 101 120 116 34 58 34 65 115 116 101 114 105 115 107 32 76 111 103 102 105 108 101 32 83 101 116 116 105 110 103 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 108 111 103 102 105 108 101 115 95 115 101 116 116 105 110 103 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 109 105 115 99 97 112 112 115 34 44 34 114 97 119 116 101 120 116 34 58 34 77 105 115 99 32 65 112 112 108 105 99 97 116 105 111 110 115 34 44 34 116 101 120 116 34 58 34 77 105 115 99 32 65 112 112 108 105 99 97 116 105 111 110 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 4๏ฟฝ๏ฟฝ?4 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 109 105 115 99 97 112 112 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 109 105 115 99 100 101 115 116 115 34 44 34 114 97 119 116 101 120 116 34 58 34 77 105 115 99 32 68 101 115 116 105 110 97 116 105 111 110 115 34 44 34 116 101 120 116 34 58 34 77 105 115 99 32 68 101 115 116 105 110 97 116 105 111 110 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 109 105 115 99 100 101 115 116 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 109 117 115 105 99 34 44 34 114 97 119 116 101 120 116 34 58 34 77 117 115 105 99 32 111 110 32 72 111 108 100 34 44 34 116 101 120 116 34 58 34 77 117 115 105 99 32 111 110 32 72 111 108 100 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 109 117 115 105 99 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 112 97 103 105 110 103 34 44 34 114 97 119 116 101 120 116 34 58 34 80 97 103 105 110 103 32 97 110 100 32 73 110 116 101 114 99 111 109 34 44 34 116 101 120 116 34 58 34 80 97 103 105 110 103 32 97 110 100 32 73 110 116 101 114 99 111 109 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 112 97 103 105 110 103 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 112 97 114 107 105 110 103 34 44 34 114 97 119 116 101 120 116 34 58 34 80 97 114 107 105 110 103 34 44 34 116 101 120 116 34 58 34 80 97 114 107 105 110 103 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 112 97 114 107 105 110 103 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 112 114 101 115 101 110 99 101 115 116 97 116 101 34 44 34 114 97 119 116 101 120 116 34 58 34 80 114 101 115 101 110 99 101 32 83 116 97 116 101 34 44 34 116 101 120 116 34 58 34 80 114 101 115 101 110 99 101 32 83 116 97 116 101 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 112 114 101 115 101 110 99 101 115 116 97 116 101 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 113 117 101 117 101 112 114 105 111 34 44 34 114 97 119 116 101 120 116 34 58 34 81 117 101 117 101 32 80 114 105 111 114 105 116 105 101 115 34 44 34 116 101 120 116 34 58 34 81 117 101 117 101 32 80 114 105 111 114 105 116 105 101 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 113 117 101 117 101 112 114 105 111 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 113 117 101 117 101 115 34 44 34 114 97 119 116 101 120 116 34 58 34 81 117 101 117 101 115 34 44 34 116 101 120 116 34 58 34 81 117 101 117 101 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 113 117 101 117 101 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 114 101 99 111 114 100 105 110 103 115 34 44 34 114 97 119 116 101 120 116 34 58 34 83 121 115 116 101 109 32 82 101 99 111 114 100 105 110 103 115 34 44 34 116 101 120 116 34 58 34 83 121 115 116 101 109 32 82 101 99 111 114 100 105 110 103 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 114 101 99 111 114 100 105 110 103 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 114 105 110 103 103 114 111 117 112 115 34 44 34 114 97 119 116 101 120 116 34 58 34 82 105 110 103 32 71 114 111 117 112 115 34 44 34 116 101 120 116 34 58 34 82 105 110 103 32 71 114 111 117 112 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 114 105 110 103 103 114 111 117 112 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 115 101 116 99 105 100 34 44 34 114 97 119 116 101 120 116 34 58 34 83 101 116 32 67 97 108 108 101 114 73 68 34 44 34 116 101 120 116 34 58 34 83 101 116 32 67 97 108 108 101 114 73 68 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 115 101 116 99 105 100 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 115 105 112 115 101 116 116 105 110 103 115 34 44 34 114 97 119 116 101 120 116 34 58 34 65 115 116 101 114 105 115 107 32 83 73 80 32 83 101 116 116 105 110 103 115 34 44 34 116 101 120 116 34 58 34 65 115 116 101 114 105 115 107 32 83 73 80 32 83 101 116 116 105 110 103 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 115 105 112 115 101 116 116 105 110 103 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 115 111 117 110 100 108 97 110 103 34 44 34 114 97 119 116 101 120 116 34 58 34 83 111 117 110 100 32 76 97 110 103 117 97 103 101 115 34 44 34 116 101 120 116 34 58 34 83 111 117 110 100 32 76 97 110 103 117 97 103 101 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 115 111 117 110 100 108 97 110 103 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 115 117 112 101 114 102 101 99 116 97 34 44 34 114 97 119 116 101 120 116 34 58 34 67 73 68 32 83 117 112 101 114 102 101 99 116 97 34 44 34 116 101 120 116 34 58 34 67 73 68 32 83 117 112 101 114 102 101 99 116 97 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 115 117 112 101 114 102 101 99 116 97 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 116 105 109 101 99 111 110 100 105 116 105 111 110 115 34 44 34 114 97 119 116 101 120 116 34 58 34 84 105 109 101 32 67 111 110 100 105 116 105 111 110 115 34 44 34 116 101 120 116 34 58 34 84 105 109 101 32 67 111 110 100 105 116 105 111 110 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 116 105 109 101 99 111 110 100 105 116 105 111 110 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 116 105 109 101 99 111 110 100 105 116 105 111 110 115 34 44 34 114 97 119 116 101 120 116 34 58 34 84 105 109 101 32 71 114 111 117 112 115 34 44 34 116 101 120 116 34 58 34 84 105 109 101 32 71 114 111 117 112 115 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 116 105 109 101 103 114 111 117 112 115 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 117 99 112 34 44 34 114 97 119 116 101 120 116 34 58 34 85 67 80 34 44 34 116 101 120 116 34 58 34 85 67 80 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 92 47 117 99 112 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 117 115 101 114 109 97 110 34 44 34 114 97 119 116 101 120 116 34 58 34 85 115 101 114 32 77 97 110 97 103 101 109 101 110 116 34 44 34 116 101 120 116 34 58 34 85 115 101 114 32 77 97 110 97 103 101 109 101 110 116 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 117 115 101 114 109 97 110 34 125 44 123 34 114 97 119 110 97 109 101 34 58 34 118 111 105 99 101 109 97 105 108 34 44 34 114 97 119 116 101 120 116 34 58 34 86 111 105 99 101 109 97 105 108 32 65 100 109 105 110 34 44 34 116 101 120 116 34 58 34 86 111 105 99 101 109 97 105 108 32 65 100 109 105 110 34 44 34 116 121 112 101 34 58 34 103 101 116 34 44 34 100 101 115 116 34 58 34 63 100 105 115 112 108 97 121 61 118 111 105 99 101 109 97 105 108 34 125 93] 0 0} true true 200 0xc000218aa0}
Ok I may actually know this issue. If you check the Accept-Encoding
header on that last request does it include br
or *
? I expect the server is encoding content in brotli which is unsupported. I have a process, currently in another plugin but could port over, that will update the request sent to the server to exclude br
from the accepted encoding to avoid this issue.
If that is the case, you can update the header with a header rewrite middlware that changes the Accept-Encoding
header to gzip
If you add a header middleware to change the Accept-Encoding
to gzip, deflate
it should work for that last call as well.
That second one may be an issue with getting application/json
Content-Type
back as well.
Having a moment re: header request rewriting - is that native to Traefik or via an/other plugin?
It's native in Traefik: https://doc.traefik.io/traefik/middlewares/http/headers/
I think it would be good to put the header middle first in your middleware chain. The rewrite-body middleware actually makes the call to the server to load content.
Ok, I've moved everything to a chain so I don't have to blip the container, and although my request header mw seems to do nothing, I can confirm I can see amended HTML with the rewritebody (testing in the section)
The irk now is that the specific thing I'm after rewriting is returned as "application/javascript" - so is ignored by the plugin.
(Freepbx returns a URL as part of the dynamic Call Record details it loads in when running a search)
So I think it would work if it was/could be picking up the dynamic content piece.
(edit : traefik has now gone mad and refuses to start with the plugin loaded)
What are the logs for the crash with the plugin loaded?
I have built a custom plugin for the more focused feature I was trying to build this plugin for. That said, if you wouldn't mind opening up a separate issue as a Feature Request for supporting application/javascript
and POST
methods I will look into adding those features for you. I think I can make those limits configurable so anyone can have the middleware focus on the content as needed.
I'm going to try again and see (I may have been rate limited somehow). The other issue is the amount of logs with DEBUG on :)
I'll do the FR in sec though :)
EDIT : Now the mw is in a chain, I've managed to get a redirectregex to behave for the first time, so I've got the functionality I wanted (I think I had an looped/ordering problem before)
I'll try and work on your FR ASAP but it may be a few days.
FYI when you are debugging most issues with this plugin, basically as long as it doesn't crash the system, you only have to add the debug config to the corresponding middleware. (Not all of Traefik ๐)
It is my understanding this issue is now closable. If any this is in correct please feel free to open this back up.
Cheers for staying with me - enabling rewrite on configurable content type (inc zipped) will certainly be useful in any case :)