mirror of
https://github.com/webmin/webmin.git
synced 2026-06-20 03:10:30 +01:00
Fix up CSS when forwarding
This commit is contained in:
@@ -137,6 +137,7 @@ else {
|
||||
|
||||
# read back the rest of the page
|
||||
if ($header{'content-type'} =~ /text\/html/ && !$header{'x-no-links'}) {
|
||||
# Fix up HTML
|
||||
while($_ = &read_http_connection($con)) {
|
||||
s/src='(\/[^']*)'/src='$url$1'/gi;
|
||||
s/src="(\/[^"]*)"/src="$url$1"/gi;
|
||||
@@ -157,7 +158,15 @@ if ($header{'content-type'} =~ /text\/html/ && !$header{'x-no-links'}) {
|
||||
print;
|
||||
}
|
||||
}
|
||||
elsif ($header{'content-type'} =~ /text\/css/ && !$header{'x-no-links'}) {
|
||||
# Fix up CSS
|
||||
while($_ = &read_http_connection($con)) {
|
||||
s/url\("(\/[^"]*)"\)/url\("$url$1"\)/gi;
|
||||
print;
|
||||
}
|
||||
}
|
||||
else {
|
||||
# Just pass through
|
||||
while($buf = &read_http_connection($con, 1024)) {
|
||||
print $buf;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user