Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Apache Bad Request 400 (o2 only)

  • 08-08-2011 3:33pm
    #1
    Registered Users, Registered Users 2 Posts: 3,141 ✭✭✭


    I am sending a http request to a REST Server running on Apache 2.2, PHP 5.3

    The request method is DELETE

    It works fine on my Three broadband (3G) and also Eircom, but on the o2 network, the server returns the following response:
    Bad Request
    Request could not be understood (Status: 400)
    

    I cannot find any information in the apache logs. I think somehow, o2 is not happy with the method DELETE and it is messing up the http headers.

    GET, POST & PUT all work fine.

    Is there anyway I can debug this error 400 to see exactly what is wrong? Or is it possible to log the raw incoming request before apache ignores it?


Comments

  • Registered Users, Registered Users 2 Posts: 3,141 ✭✭✭ocallagh


    Just an update to this in case anyone finds a similar issue.

    The call to the REST server works in nearly every case except for the following:

    iOS SDK 4 - in app (using NSUrlRequest) on O2
    iOS SDK 4 - in app (using NSUrlRequest) on Vodafone
    Safari on iphone 3, 3GS and 4 on O2
    Safari on iphone 3, 3GS and 4 on Vodafone

    In all other cases the call to the REST server is fine. It works on all platforms above with Three or Eircom. It also works on all other platforms on all networks (ie: Android, Nokia, Linux, Windows, Snow Leopard)

    On Vodafone the request times out with error 400 after 120 seconds.
    On O2 it returns error 400 immediately.

    I cannot find a fix and am completely stumped. I think it's related to how the latest iOS SDK creates the http request, but I don't know why it works on some ISPs and not others.

    For now we have a work around using POST method and a delete flag but if anyone can shed any light on it I'd like to fix it up.


  • Registered Users, Registered Users 2 Posts: 981 ✭✭✭fasty


    I'm assuming you're in control of the server these apps are accessing?

    How about using a packet sniffer/capture tool like Wireshark to see incoming requests to Apache? That was you could LOOK at the header of the DELETE request from iOS 4 and compare it to a known good one from another platform?

    Does it work with iOS over wireless as opposed to O2/Vodafone data networks?

    It could be something INSANE like the iOS version not supporting anything other than GET or POST but I couldn't find anything in the documentation about that.

    If this is the case, I suppose you could use the Core Foundation stuff or maybe another HTTP request library?


  • Registered Users, Registered Users 2 Posts: 2,013 ✭✭✭lynchie


    If you are using Vodafones 3G connections the default APN (live) goes through a transparent proxy which may or may not be filtering your requests. If you are using the live APN see if you can test it using the ISP apn which afaik doesnt have the proxy in place.

    I assume o2's internet APN has a similar configuration too.


  • Registered Users, Registered Users 2 Posts: 3,141 ✭✭✭ocallagh


    Yep - in control of the server. It's a production server though and didn't want to go re-compiling apache (for dumpio) or installing other software just yet. I'm going to look at the packets coming through on our dev server when I get a chance to get a build of the app for it (Now we have work around it's less of an issue).

    It does work over wireless on iOS fatsy.

    In regards Voda/O2 filtering through their default APNs this may well be the case. I had suspected this and a work colleague thought it would be a much wider issue if it was the case (Google brings up nothing on it). I'm guessing the results of inspecting the packet data may reveal something to that effect. It does work through my Nokia connection (hs.vodafone.ie) I'll try live.vodafone.com and see if it makes a difference. The more I think about it, it must be the ISP filtering the request when using a specific APN, but maybe the iOS SDk is triggering it

    To test the call to the REST server I created just a simple request using a standard jquery ajax call (with method type DELETE) and ran it in safari on my iphone. Same result as calling it through NsUrlRequest, Bad Request Error 400. It may be the latest IOS SDK is creating malformed http requests which Three/Eircom just don't care about but Voda/O2 filter on?

    Weird one, thanks for replies


Advertisement