# Unexpected CRLF with HTTP Version

**URL:** <https://community.f5.com/t/unexpected-crlf-with-http-version/25011>\
**Category:** Technical Forums\
**Tags:** irules, dev, devops, application-delivery\
**Created:** [June 30, 2010, 3:03am UTC](https://community.f5.com/t/unexpected-crlf-with-http-version/25011 "2010-06-30T03:03:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raj\_74912](https://avatars.discourse-cdn.com/v4/letter/r/cdc98d/32.png) [@Raj\_74912](https://community.f5.com/u/Raj_74912)\
**Post date:** [June 30, 2010, 3:03am UTC](https://community.f5.com/t/unexpected-crlf-with-http-version/25011/1 "2010-06-30T03:03:19Z")

</div>

Guys,

Need your help with this.

I am running version 9.4.8 and I am noticing that if I change the HTTP version in an iRule it adds extra CRLF after the irule changes the HTTP version. Any way to tell the irule not to add the extra CRLF when changing HTTP version?

So in summary when I update the HTTP version in a HTTP request I see the following: HTTP/1.0\r\n\r\n.

iRule:

if { [HTTP::version] eq “1.1” } {

if { [HTTP::header is\_keepalive] } {

HTTP::header replace “Connection” “Keep-Alive”

}

HTTP::version “1.0”

} else {

if { [HTTP::version] eq “0.9” || [HTTP::version] eq “” } {

HTTP::version “1.0”

}

HTTP::version “1.0”

}

Thanks

Raj

---

<div class="post-metadata">

**Author:** ![The\_Bhattman](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/the_bhattman/32/13958_2.png) [@The\_Bhattman](https://community.f5.com/u/The_Bhattman)\
**Post date:** [June 30, 2010, 4:05am UTC](https://community.f5.com/t/unexpected-crlf-with-http-version/25011/2 "2010-06-30T04:05:07Z")

</div>

Hi Raj,

I am not that well versed in http, but it seems as though if you are version .9 or you don’t have a version- to switch to version 1.0 twice. Wouldn’t that be redundant?

Bhattman

---

<div class="post-metadata">

**Author:** ![Raj\_74912](https://avatars.discourse-cdn.com/v4/letter/r/cdc98d/32.png) [@Raj\_74912](https://community.f5.com/u/Raj_74912)\
**Post date:** [June 30, 2010, 6:41pm UTC](https://community.f5.com/t/unexpected-crlf-with-http-version/25011/3 "2010-06-30T18:41:40Z")

</div>

It will only upgrade it if its not 1.0. Yes, little redundant but should not hurt. I have removed the extra HTTP::version 1.0 with no change visable.

The issue is when F5 inserts/upgrades to HTTP version 1.0 it inserts two CRLF’s making that line be the end of HTTP header. All additional info in HTTP header is then ignored by the server.

---

<div class="post-metadata">

**Author:** ![hoolio](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@hoolio](https://community.f5.com/u/hoolio)\
**Post date:** [July 1, 2010, 9:52am UTC](https://community.f5.com/t/unexpected-crlf-with-http-version/25011/4 "2010-07-01T09:52:09Z")

</div>

Hi Raj,

If you can capture tcpdumps of such a failure on the inbound and outbound connections showing an extra CRLF being inserted when using HTTP::version in an iRule, I’d open a case with F5 Support as it sounds like a bug.

Aaron

---

<div class="post-metadata">

**Author:** ![Raj\_74912](https://avatars.discourse-cdn.com/v4/letter/r/cdc98d/32.png) [@Raj\_74912](https://community.f5.com/u/Raj_74912)\
**Post date:** [July 2, 2010, 9:55pm UTC](https://community.f5.com/t/unexpected-crlf-with-http-version/25011/5 "2010-07-02T21:55:50Z")

</div>

I did open a case with F5 and they are saying its because of iRule and that I should buy professional services.

---

<div class="post-metadata">

**Author:** ![hoolio](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@hoolio](https://community.f5.com/u/hoolio)\
**Post date:** [July 4, 2010, 2:37pm UTC](https://community.f5.com/t/unexpected-crlf-with-http-version/25011/6 "2010-07-04T14:37:27Z")

</div>

If an iRule command appears to have a bug, F5 Support should open a case for you and help diagnose the issue. They won’t write iRules for you though. As long as you make it clear that you think there might be a bug in an iRule command they should help.

In a quick test on 10.2.0 I didn’t see a problem though:

```tcl
when HTTP_REQUEST {
   if { [HTTP::version] eq "0.9" || [HTTP::version] eq "" } {
      HTTP::version "1.0"
   }
}

```

Request into LTM

14:59:17.214679 IP 10.40.132.13.tr-rsrb-p3 \> 10.42.2.102.http: P 1:7(6) ack 1 win 65535 in slot1/tmm1 lis=hooleya\_http\_asm

0x0000: 0ffe 0800 4500 002e 9b68 4000 7c06 c89c …E…h@.|…

0x0010: 0a28 840d 0a2a 0266 07c5 0050 0804 82fe .(…\*.f…P…

0x0020: 6f61 52be 5018 ffff f55a 0000 **4745 5420** oaR.P…Z.. **GET.**

0x0030: **2f0a** 0114 0001 0001 686f 6f6c 6579 615f **/.** …hooleya\_

0x0040: 6874 7470 5f61 736d http\_asm

Request to pool member

14:59:17.218149 IP 10.42.2.2.tr-rsrb-p3 \> 10.42.15.62.http: P 1:36(35) ack 1 win 4380 out slot1/tmm1 lis=hooleya\_http\_asm

0x0000: 0ffe 0800 4500 004b 43a7 4000 ff06 1272 …E..KC.@…r

0x0010: 0a2a 0202 0a2a 0f3e 07c5 0050 023d 50ed .\*…\*.\>…P.=P.

0x0020: dae8 9ead 5018 111c 5b6b 0000 **4745 5420** …P…[k.. **GET.**

0x0030: **2f20 4854 5450 2f31 2e30 0d0a** 436f 6e6e **/.HTTP/1.0..** Conn

0x0040: 6563 7469 6f6e 3a20 636c 6f73 650a 0a01 ection:.close…

0x0050: 1400 0000 0168 6f6f 6c65 7961 5f68 7474 …hooleya\_htt

0x0060: 705f 6173 6d p\_asm

Aaron
