@@ -152,3 +152,22 @@ def test_find_all_headers():
152
152
153
153
assert (result [0 ] == "JSESSIONID=E677B51BA5C4837347D1E17D4E36647E; Path=/data-server; Secure; HttpOnly" )
154
154
assert (result [1 ] == "SESSION=ZjQ3MjIzMDAtNjNiYy00Mj; Path=/data-server; Secure; HttpOnly; SameSite=Lax" )
155
+
156
+
157
+ def test_get_file_from_header ():
158
+ host = "testHost"
159
+ tap = TapConn (ishttps = False , host = host )
160
+
161
+ headers = [('Date' , 'Sat, 12 Apr 2025 05:10:47 GMT' ),
162
+ ('Server' , 'Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.2k-fips mod_jk/1.2.43' ),
163
+ ('Set-Cookie' , 'JSESSIONID=E677B51BA5C4837347D1E17D4E36647E; Path=/data-server; Secure; HttpOnly' ),
164
+ ('X-Content-Type-Options' , 'nosniff' ), ('X-XSS-Protection' , '0' ),
165
+ ('Cache-Control' , 'no-cache, no-store, max-age=0, must-revalidate' ), ('Pragma' , 'no-cache' ),
166
+ ('Expires' , '0' ), ('X-Frame-Options' , 'SAMEORIGIN' ),
167
+ ('Set-Cookie' , 'SESSION=ZjQ3MjIzMDAtNjNiYy00Mj; Path=/data-server; Secure; HttpOnly; SameSite=Lax' ),
168
+ ('Transfer-Encoding' , 'chunked' ), ('Content-Type' , 'text/plain; charset=UTF-8' ),
169
+ ('Content-Disposition' , 'filename="my_file.vot.gz"' ), ('Content-Encoding' , "gzip" )]
170
+
171
+ result = tap .get_file_from_header (headers )
172
+
173
+ assert (result == "my_file.vot.gz" )
0 commit comments