@@ -151,30 +151,6 @@ def md_filter_add_syntax_highlight(md):
151
151
return False
152
152
153
153
154
- if django .VERSION >= (4 , 2 ):
155
- # Django 4.2+: use the stock parse_header_parameters function
156
- # Note: Django 4.1 also has an implementation of parse_header_parameters
157
- # which is slightly different from the one in 4.2, it needs
158
- # the compatibility shim as well.
159
- from django .utils .http import parse_header_parameters
160
- else :
161
- # Django <= 4.1: create a compatibility shim for parse_header_parameters
162
- from django .http .multipartparser import parse_header
163
-
164
- def parse_header_parameters (line ):
165
- # parse_header works with bytes, but parse_header_parameters
166
- # works with strings. Call encode to convert the line to bytes.
167
- main_value_pair , params = parse_header (line .encode ())
168
- return main_value_pair , {
169
- # parse_header will convert *some* values to string.
170
- # parse_header_parameters converts *all* values to string.
171
- # Make sure all values are converted by calling decode on
172
- # any remaining non-string values.
173
- k : v if isinstance (v , str ) else v .decode ()
174
- for k , v in params .items ()
175
- }
176
-
177
-
178
154
if django .VERSION >= (5 , 1 ):
179
155
# Django 5.1+: use the stock ip_address_validators function
180
156
# Note: Before Django 5.1, ip_address_validators returns a tuple containing
0 commit comments