web: remove unnecessary template copying build step (#7490)

This commit is contained in:
Maximilian Hils 2025-01-17 18:09:45 +01:00 committed by GitHub
parent 99e79f7619
commit e78ab0ffd9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 50 deletions

View file

@ -1,19 +1,15 @@
<!doctype html>
<html>
<head lang="en">
<meta charset="UTF-8" />
<title>mitmproxy</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href=".{{ static_url('vendor.css') }}" />
<link rel="stylesheet" href=".{{ static_url('app.css') }}" />
<link
rel="icon"
href=".{{ static_url('images/favicon.ico') }}"
type="image/x-icon"
/>
<script src=".{{ static_url('app.js') }}"></script>
</head>
<body>
<div id="mitmproxy"></div>
</body>
<html lang="en">
<head>
<meta charset="utf-8">
<title>mitmproxy</title>
<link rel="icon" href=".{{ static_url('images/favicon.ico') }}" type="image/x-icon"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href=".{{ static_url('vendor.css') }}" />
<link rel="stylesheet" href=".{{ static_url('app.css') }}" />
<script src=".{{ static_url('app.js') }}"></script>
</head>
<body>
<div id="mitmproxy"></div>
</body>
</html>

View file

@ -86,10 +86,10 @@ class TestApp(tornado.testing.AsyncHTTPTestCase):
)
def test_index(self):
response: httpclient.HTTPResponse = self.fetch("/")
response = self.fetch("/")
assert response.code == 200
assert '"/' not in str(
response.body
assert (
b'="/' not in response.body
), "HTML content should not contain root-relative paths"
def test_filter_help(self):

View file

@ -82,14 +82,6 @@ function copy() {
.pipe(gulp.dest("../mitmproxy/tools/web/static"));
}
const template_src = "src/templates/*";
function templates() {
return gulp
.src(template_src, { base: "src/" })
.pipe(gulp.dest("../mitmproxy/tools/web"));
}
const peg_src = "src/js/filt/*.peg";
function peg() {
@ -114,7 +106,6 @@ const dev = gulp.parallel(
styles_app_dev,
peg,
scripts_dev,
templates,
);
const prod = gulp.parallel(
@ -123,7 +114,6 @@ const prod = gulp.parallel(
styles_app_prod,
peg,
scripts_prod,
templates,
);
exports.dev = dev;
@ -134,7 +124,6 @@ exports.default = function watch() {
gulp.watch(["src/css/vendor*"], opts, styles_vendor_dev);
gulp.watch(["src/css/**"], opts, styles_app_dev);
gulp.watch(["src/js/**"], opts, scripts_dev);
gulp.watch(template_src, opts, templates);
gulp.watch(peg_src, opts, peg);
gulp.watch(copy_src, opts, copy);
};

View file

@ -1,19 +0,0 @@
<!doctype html>
<html>
<head lang="en">
<meta charset="UTF-8" />
<title>mitmproxy</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href=".{{ static_url('vendor.css') }}" />
<link rel="stylesheet" href=".{{ static_url('app.css') }}" />
<link
rel="icon"
href=".{{ static_url('images/favicon.ico') }}"
type="image/x-icon"
/>
<script src=".{{ static_url('app.js') }}"></script>
</head>
<body>
<div id="mitmproxy"></div>
</body>
</html>