Created
November 5, 2017 09:43
-
-
Save aw/0e999d2dd8f0613a880b9853711fb538 to your computer and use it in GitHub Desktop.
Monkey-patch PicoLisp http.l
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
| (patch _htHead | |
| '(case (lowc (till " ^M^J" T)) @S) | |
| (fill '(case (lowc (till " ^M^J" T)) | |
| ("auth-hash:" (setq *AUTH_HASH (pack (cdr (line))))) | |
| ("auth-cookie:" (setq *AUTH_COOKIE (pack (cdr (line))))) | |
| ("auth-token:" (setq *AUTH_TOKEN (pack (cdr (line))))) | |
| . @S) ) ) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For the curious, this adds 3 additional HTTP request headers to the
_htHeadfunction, and sets them as global variables, while leaving the rest of the function intact.