# Altering responses

**URL:** <https://discourse.haproxy.org/t/altering-responses/1014>\
**Category:** Help!\
**Created:** [February 18, 2017, 8:54pm UTC](https://discourse.haproxy.org/t/altering-responses/1014 "2017-02-18T20:54:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Markvr](https://avatars.discourse-cdn.com/v4/letter/m/d78d45/32.png) [@Markvr](https://discourse.haproxy.org/u/Markvr)\
**Post date:** [February 18, 2017, 8:54pm UTC](https://discourse.haproxy.org/t/altering-responses/1014/1 "2017-02-18T20:54:49Z")

</div>

From reading the manual, I’m pretty sure this isn’t possible but thought I’d double check…

Is it possible to alter the HTTP content (not headers)? Specifically to inject some HTML into the start of the body?

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [February 22, 2017, 7:37pm UTC](https://discourse.haproxy.org/t/altering-responses/1014/2 "2017-02-22T19:37:20Z")

</div>

No, its not possible out of the box.

Not sure if that’s you, but there is a discussion about this on the ML:  
[https://www.mail-archive.com/haproxy@formilux.org/msg25011.html](https://www.mail-archive.com/haproxy@formilux.org/msg25011.html)

---

<div class="post-metadata">

**Author:** ![Markvr](https://avatars.discourse-cdn.com/v4/letter/m/d78d45/32.png) [@Markvr](https://discourse.haproxy.org/u/Markvr)\
**Post date:** [February 24, 2017, 12:46pm UTC](https://discourse.haproxy.org/t/altering-responses/1014/3 "2017-02-24T12:46:26Z")

</div>

No, that wasn’t me. Shame it isn’t possible, it would obviously have a significant performance impact, but there are situations it would be very useful. In my case, I want to inject some JavaScript to pop up a message warning visitors the website will shortly be unavailable. It’s easier to centralise this in one place, than need to do it across lots of separate back end applications.

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [February 24, 2017, 3:08pm UTC](https://discourse.haproxy.org/t/altering-responses/1014/4 "2017-02-24T15:08:59Z")

</div>

Its not only performance impacting but also dangerous:

> **[Incident report on memory leak caused by Cloudflare parser bug](https://blog.cloudflare.com/incident-report-on-memory-leak-caused-by-cloudflare-parser-bug/)**
>
> Last Friday, Tavis Ormandy from Google’s Project Zero contacted Cloudflare to report a security problem with our edge servers. He was seeing corrupted web pages being returned by some HTTP requests run through Cloudflare.
