TSHTTPHDRCOPY(3ts)

πŸ“¦
version 9.2.5 Β· 5 versions
, in ubuntu questing

πŸ’– TSHTTPHDRCOPY πŸ’–

okay bestie, welcome to the TSHTTPHDRCOPY(3ts) page from the Apache Traffic Server manual πŸ¦‹ she's a tiny one but she's mighty, and she's about to save your whole entire day. sit down, hydrate, let's go ✨


🌸 NAME 🌸

TSHttpHdrCopy β€” copies the contents of the HTTP header located at src_loc within src_bufp to the HTTP header located at dest_loc within dest_bufp

like… it literally does exactly what it says on the tin. no cap πŸ’…


✨ SYNOPSIS ✨

#include <ts/ts.h>

TSReturnCode TSHttpHdrCopy(TSMBuffer dest_bufp, TSMLoc dest_offset,
TSMBuffer src_bufp, TSMLoc src_offset)

yes the include is <ts/ts.h>, yes you need it, yes it goes at the top, periodt πŸŽ€


🫢 DESCRIPTION 🫢

okay so here's the tea β˜• TSHttpHdrCopy() is out here working correctly even when src_bufp and dest_bufp are pointing at different Marshal Buffers. she does not care. she does not gatekeep. she copies across buffers like the icon she is πŸ‘‘

but β€” and this is the important part, bestie, do not skip this β€” you must make sure that you create the destination HTTP header before you copy into it. create first, copy second. that's the order. the vibe check will fail otherwise 😭

NOTE: 🚨 TSHttpHdrCopy() appends the port number to the domain of the URL portion of the header. so if you copy http://www.example.com, what lands in the destination buffer is http://www.example.com:80 β€” the :80 is just there now, uninvited but very much present πŸ™ˆ

2026, dev@trafficserver.apache.org


and that's the whole page, bestie, you ate that πŸ’…πŸ’– this was TSHTTPHDRCOPY(3ts) from Apache Traffic Server version 9.2, dated Feb 12, 2026 β€” go forth and copy those headers, you absolute main character πŸŒˆβ­πŸ“

πŸ“¦ where this page comes from