Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

Why we are getting Body in Get or Head Request

MSZ_221163
Nimbostratus
Nimbostratus

GET /testweb/login/login.html HTTP/1.1 Host: abcon.testing.com Content-Type: text/html Accept: / Cookie: _ga=GA1.2.2065954655.1528020905; _gid=GA1.2.251813925.1542006455; language=10 User-Agent: AlohaBrowser/2.6.2 (com.alohabrowser.alohabrowser; build:1; iOS 11.4.0) Alamofire/4.7.3 Accept-Language: ar-SA;q=1.0 Connection: keep-alive X-Forwarded-For: [x.x.x.x]

 

3 REPLIES 3

Hamish
Cirrocumulus
Cirrocumulus

Please reformat your question using code blocks to make it readable.

 

MSZ
Nimbostratus
Nimbostratus

I am experiencing the Blocked request due to the following reason: HTTP Protocol Compliance Failed: Body in GET or HEAD request.

 

Following is the detailed example of logs:

 

GET /testweb/login/login.html HTTP/1.1

 

Host: abcon.testing.com

 

Content-Type: text/html

 

Accept: / Cookie: _ga=GA1.2.2065954655.1528020905; _gid=GA1.2.251813925.1542006455; language=10

 

User-Agent: AlohaBrowser/2.6.2 (com.alohabrowser.alohabrowser; build:1; iOS 11.4.0) Alamofire/4.7.3

 

Accept-Language: ar-SA;q=1.0

 

Connection: keep-alive

 

X-Forwarded-For: [x.x.x.x]

 

Hamish
Cirrocumulus
Cirrocumulus

That's not very clear... Where are you seeing this blocked? What's generating the request and what is generating the response? There's very few mind-readers or magicians online so you'll have to do a bit of legwork to explain what's happening in your scenario.

 

But... To try & be helpful. What you are seeing is a server complaining that a request (GET) is being sent with body data included. The HTTP protocol doesn't explicitly forbid that. But it makes no sense to include a body and should be ignored. However it looks like whoever wrote the server you're talking to had other ideas and thought they'd be extra strict.

 

There's a discussion on stack overflow about this sort of scenario BODY with GET. As with most things where there's ambiguity in the spec there's a bit of an argument over who's right and wrong, but the main thing you should take from this is that there's a disagreement on how the protocol should work at each end and one of them has to give way for things to work properly.

 

Now, why are you getting a body in the GET? You'd have to ask whoever wrote your client. have you tcpdump'ed the request to verify that there really is a body? And you don't have something in the middle adding it? Like all debugging, it's about what you can prove.