Skip to content

Commit 9e51a07

Browse files
committed
Code review fix
1 parent f4471f2 commit 9e51a07

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/rp2_common/pico_lwip/tools/makefsdata.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ def process_file(input_dir, file):
5454
results.append({'data': bytes(data, "utf-8"), 'comment': comment});
5555

5656
# content type and content encoding
57+
content_type_header = f"Content-Type: {content_type}"
5758
if content_encoding is None:
58-
data = f"Content-Type: {content_type}\r\n\r\n"
59-
comment = f"\"Content-Type: {content_type}\" ({len(data)} chars)"
59+
data = f"{content_type_header}\r\n\r\n"
60+
comment = f"\"{content_type_header}\" ({len(data)} chars)"
6061
else:
61-
data = f"Content-Type: {content_type}\r\nContent-Encoding: {content_encoding}\r\n\r\n"
62-
comment = f"\"Content-Type: {content_type} Content-Encoding: {content_encoding}\" ({len(data)} chars)"
62+
content_encoding_header = f"Content-Encoding: {content_encoding}"
63+
data = f"{content_type_header}\r\n{content_encoding_header}\r\n\r\n"
64+
comment = f"\"{content_type_header} {content_encoding_header}\" ({len(data)} chars)"
6365
results.append({'data': bytes(data, "utf-8"), 'comment': comment});
6466

6567
# file contents

0 commit comments

Comments
 (0)