Skip to content

Instantly share code, notes, and snippets.

@aw
Created November 5, 2017 09:43
Show Gist options
  • Select an option

  • Save aw/0e999d2dd8f0613a880b9853711fb538 to your computer and use it in GitHub Desktop.

Select an option

Save aw/0e999d2dd8f0613a880b9853711fb538 to your computer and use it in GitHub Desktop.
Monkey-patch PicoLisp http.l
(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) ) )
@aw
Copy link
Copy Markdown
Author

aw commented Nov 5, 2017

For the curious, this adds 3 additional HTTP request headers to the _htHead function, and sets them as global variables, while leaving the rest of the function intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment