Last active
December 19, 2015 12:09
-
-
Save sethhall/5952451 to your computer and use it in GitHub Desktop.
grabbing content-disposition headers only in certain cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @load base/protocols/http | |
| const watchlist_url_patterns = /^.*/test.php\// &redef; | |
| redef record Conn::Info += { | |
| content_disposition: string &optional &log; | |
| }; | |
| event http_all_headers(c: connection, is_orig: bool, hlist: mime_header_list) | |
| { | |
| if ( ! is_orig || c$http$method != "POST" ) | |
| return; | |
| local url = HTTP::build_url(c$http); | |
| if ( HTTP::watchlist_url_patterns in url ) | |
| { | |
| for ( i in hlist ) | |
| { | |
| local hdr = hlist[i]i$name; | |
| local value = hlist[i]$value; | |
| if ( hdr == "CONTENT-DISPOSITION" ) | |
| c$http$content_disposition = value; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment