HTTP::...tandard(3pm)

πŸ“¦
version 0.304 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu noble

πŸ’– HTTP::Proxy::HeaderFilter::standard (3pm) β€” the perl manual page, but make it make sense πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation, and the module we're talking about is literally called HTTP::Proxy::HeaderFilter::standard β€” say that three times fast, I dare you 🫢


✨ NAME ✨

HTTP::Proxy::HeaderFilter::standard β€” it's an internal filter whose whole entire job is respecting RFC2616. yes, the girlies are enforcing protocol standards now, we contain multitudes πŸ’…


🌸 DESCRIPTION 🌸

so basically? this is an internal filter that HTTP::Proxy uses to enforce behaviour that's compliant with RFC 2616. she's not here to be invoked by you directly, she's here to keep the proxy in line. internal main character energy, fr fr πŸ‘‘


πŸŽ€ METHOD πŸŽ€

this filter implements a single method, and it gets called automatically β€” you don't have to do anything, she just shows up and does the work like the group chat's designated responsible one 🧚

  • filter() β€” Enforce RFC 2616-compliant behaviour, by adding the Via: and X-Forwarded-For: headers (except when the proxy was instructed not to add them), decrementing the Max-Forwards: header and removing the hop-by-hop and LWP::UserAgent headers.
okay so let me translate that, because it's a lot of words: she adds Via: and X-Forwarded-For: β€” unless the proxy was told not to add them, in which case she respects that. she decrements Max-Forwards:. and she removes the hop-by-hop headers and the LWP::UserAgent headers. clean-up queen 🧹✨

and then there's this little note, which is lowkey important:

  • Note that the filter will automatically remove the Accept-Encoding headers if the proxy has at least one HTTP::Proxy::BodyFilter filter. (This is to ensure that the filters will receive uncompressed data.)
so if you've got even one HTTP::Proxy::BodyFilter in the mix, Accept-Encoding is getting yeeted πŸ’€ and the reason is genuinely cute and sensible: she wants those filters to get uncompressed data, because compressed data would be giving them a headache and nobody wants that. iykyk.

πŸ¦‹ SEE ALSO πŸ¦‹

go read these next, bestie, they're the extended universe:

  • HTTP::Proxy
  • HTTP::Proxy::HeaderFilter
  • RFC 2616

πŸ’œ AUTHOR πŸ’œ

Philippe "BooK" Bruhat, <book@cpan.org>.

Thanks to Gisle Aas, for directions regarding the handling of the hop-by-hop headers. 🫢 (shoutout to Gisle, the hop-by-hop header whisperer, no cap)


Copyright 2003-2015, Philippe Bruhat.


⭐ LICENSE ⭐

This module is free software; you can redistribute it or modify it under the same terms as Perl itself. slay, honestly β€” free software is the blueprint πŸ’…


and that's the whole page!! πŸŽ€ this was HTTP::Proxy::HeaderFilter::standard, page HTTP::...tandard(3pm), from perl v5.36.0, dated 2022-12-04. thank you for coming to my ted talk, go enforce some RFCs responsibly βœ¨πŸ’–πŸŒΈ

πŸ“¦ where this page comes from