Topic
  • 7 replies
  • Latest Post - ‏2013-09-10T17:27:11Z by Ramsyee
Ramsyee
Ramsyee
130 Posts

Pinned topic No Host Header in Clients request

‏2013-09-03T22:22:04Z |

Folks,

Usecase

 

Client---->DP(WSP)------Backend

req and resp "non-xml"

I am getting this following error in dp, when Client making a call to dp. I shared the same logs to client, they come up saying they dont have an option to add the this host header, but when they directly hit the backend, they get successful response.

 


Request 
processing 

failed: 
No 
host 
header, 
the 
malformed 
header 
is (
The 
Host 
field 
in 
HTTP 
header 
is 
missing), 
from 

URL:

I have even tried to add Host Header by using Headers /Params section, but no use. Is there any way I can add this in the incoming request.

 

please share your thoughts

 

 

  • kenhygh
    kenhygh
    1787 Posts

    Re: No Host Header in Clients request

    ‏2013-09-04T01:29:18Z  

    try turning on HTTP 1.0 support in your FSH

  • Ramsyee
    Ramsyee
    130 Posts

    Re: No Host Header in Clients request

    ‏2013-09-04T04:26:41Z  
    • kenhygh
    • ‏2013-09-04T01:29:18Z

    try turning on HTTP 1.0 support in your FSH

    Ok I will try that,

    by(default) the way its already enabled right?

     

  • HermannSW
    HermannSW
    5471 Posts

    Re: No Host Header in Clients request

    ‏2013-09-04T07:12:31Z  
    • Ramsyee
    • ‏2013-09-04T04:26:41Z

    Ok I will try that,

    by(default) the way its already enabled right?

     

    From the HTTP 1.1 spec (page 128):
    http://www.ietf.org/rfc/rfc2616.txt

    "...  A client MUST include a Host header field in all HTTP/1.1 request messages . ..."

    Please disable the "HTTP 1.,1" method in you FSH, since what your client sends might claim to be HTTP 1.1, but is not.

    You can take a packet capture and then do Follow TCP Stream in eg. Wireshark.
    If you then see "POST / HTTP/1.1" at request start you know your client is cheating if he does not send Host header.

    I doubt that you can do anything since this happens at the FSH protocol level before invocing any rule processing.


    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

  • Ramsyee
    Ramsyee
    130 Posts

    Re: No Host Header in Clients request

    ‏2013-09-04T16:53:12Z  
    • HermannSW
    • ‏2013-09-04T07:12:31Z

    From the HTTP 1.1 spec (page 128):
    http://www.ietf.org/rfc/rfc2616.txt

    "...  A client MUST include a Host header field in all HTTP/1.1 request messages . ..."

    Please disable the "HTTP 1.,1" method in you FSH, since what your client sends might claim to be HTTP 1.1, but is not.

    You can take a packet capture and then do Follow TCP Stream in eg. Wireshark.
    If you then see "POST / HTTP/1.1" at request start you know your client is cheating if he does not send Host header.

    I doubt that you can do anything since this happens at the FSH protocol level before invocing any rule processing.


    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

    Thanks Hermann,

     

    I am using a WSP, but the log says its mpgw. here is the complete log, when the transaction is fired by client

     

    mpgw error     0x80e00160 source-http (FSH_Http_XXXX): Request processing failed: No host header, the malformed header is (The Host field in HTTP header is missing), from URL: IPADREES
    mpgw debug     0x80e0013b source-http (FSH_Http_XXXX): HTTP Transaction # 1 on this TCP connection
    mpgw info     0x80e0013a source-http (FSH_Http_XXXX): Received HTTP/1.1 POST for / from IPADRESS

     

     

  • msiebler
    msiebler
    141 Posts

    Re: No Host Header in Clients request

    ‏2013-09-04T18:08:55Z  
    • Ramsyee
    • ‏2013-09-04T16:53:12Z

    Thanks Hermann,

     

    I am using a WSP, but the log says its mpgw. here is the complete log, when the transaction is fired by client

     

    mpgw error     0x80e00160 source-http (FSH_Http_XXXX): Request processing failed: No host header, the malformed header is (The Host field in HTTP header is missing), from URL: IPADREES
    mpgw debug     0x80e0013b source-http (FSH_Http_XXXX): HTTP Transaction # 1 on this TCP connection
    mpgw info     0x80e0013a source-http (FSH_Http_XXXX): Received HTTP/1.1 POST for / from IPADRESS

     

     

     

    The core problem is that your HTTP client is sending a HTTP/1.1 request when it should be sending a HTTP/1.0 request. You must change the client; otherwise it will not work w/ DataPower

     

    P.S. - the log message metadata may be a little confusing; since the 'category' is mpgw; but actually this is a little incorrect; since the HTTP FSPH (the source-http) is shared by both the WS-Proxy & the MPGW ; but that is a different issue; its not really relevant to your problem

     

  • Ramsyee
    Ramsyee
    130 Posts

    Re: No Host Header in Clients request

    ‏2013-09-06T17:35:18Z  
    • msiebler
    • ‏2013-09-04T18:08:55Z

     

    The core problem is that your HTTP client is sending a HTTP/1.1 request when it should be sending a HTTP/1.0 request. You must change the client; otherwise it will not work w/ DataPower

     

    P.S. - the log message metadata may be a little confusing; since the 'category' is mpgw; but actually this is a little incorrect; since the HTTP FSPH (the source-http) is shared by both the WS-Proxy & the MPGW ; but that is a different issue; its not really relevant to your problem

     

     

    Thanks

    This was my note sent

    Issue is when Client is sending a request to dp it uses Http 1.1 version, as per Http specs, Http 1.1 request should always have Host Header (see the http specs ), but in reality its not sending the Host header( I assume Client behind the scenes was supposed to use Http 1.0, instead its using Http 1.1).

    Any other workaround???

     

    The other issue( mpgw log issue, opened PMR, they would fix it in higher versions hopefully )....thanks for clarification.

     

     

     

     

  • Ramsyee
    Ramsyee
    130 Posts

    Re: No Host Header in Clients request

    ‏2013-09-10T17:27:11Z  
    • Ramsyee
    • ‏2013-09-06T17:35:18Z

     

    Thanks

    This was my note sent

    Issue is when Client is sending a request to dp it uses Http 1.1 version, as per Http specs, Http 1.1 request should always have Host Header (see the http specs ), but in reality its not sending the Host header( I assume Client behind the scenes was supposed to use Http 1.0, instead its using Http 1.1).

    Any other workaround???

     

    The other issue( mpgw log issue, opened PMR, they would fix it in higher versions hopefully )....thanks for clarification.

     

     

     

     

    Client cannot change the HTTP version, now I need to figure out a way, how can be this done in dp.

    Any Suggestions?