File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -146,14 +146,14 @@ def process_request(self, request_body):
146
146
ctt = str (response .content , 'utf-8' ).replace ("https://todo-backend-sinatra.herokuapp.com" , "http://localhost:61417" ) \
147
147
.replace ("todo-backend-sinatra.herokuapp.com" , "localhost:61417" ).encode ("utf-8" )
148
148
149
+ self .send_header ("Content-Length" , str (len (ctt )))
149
150
for name , value in sorted (response .headers .items ()):
150
- if name == "Content-Length" :
151
- value = str (len (ctt ))
152
-
153
151
value = value .replace ("https://todo-backend-sinatra.herokuapp.com" , "http://localhost:61417" )\
154
152
.replace ("todo-backend-sinatra.herokuapp.com" , "localhost:61417" )
155
153
156
- self .send_header (name , value )
154
+ if name != 'Transfer-Encoding' : # skip Transfer-Encoding as we are setting Content-Length
155
+ self .send_header (name , value )
156
+
157
157
self .end_headers ()
158
158
self .wfile .write (response .content )
159
159
rsp_body = str (response .content , encoding = 'utf-8' )
You can’t perform that action at this time.
0 commit comments