Handling invalid headers without sending status code 400



I'm trying to use libsoup to create a REST server as an AirPlay client.  (The REST interface for AirPlay is 
"documented" here - http://nto.github.io/AirPlay.html)

The problem that I'm having is that the soup server appears to choke on the requests that the iPad's AirPlay 
client is sending.  I grabbed a tcpdump of the exchange and opened it in WireShark, a request looks like:

GET /server-info HTTP/1.1
X-Apple-Client-Name: iPad
X-Apple-VV: 16777984
Content-Length: 0
X-Apple-Device-ID: (Hex value here)
X-Apple-Session-ID: (UUID here)
User-Agent: AirPlay/190.9 (Photos)

(The linebreaks are \r\n, FWIW)


My SoupServer gets this request, and immediately returns 

HTTP/1.1 400 Bad Request
Content-Length: 0

I get a few events, "request-started" from the server, then "finished" from the message, then 
"request-aborted" from the server.  

I can point a web browser at the same path, and everything works fine, so no doubt this is something unique 
to the way the AirPlay client on iPad is making the request.  I understand that this is most likely not a 
libsoup bug, and it's probably Apple doing something non-standard in some funky corner of their iPad code.  
However, I need to handle these requests nonetheless.

Is there some way to handle these bad requests via libsoup that I'm not aware of?  The signals don't seem to 
give me access to any of the raw data, and the library is choking on the request.  I could always switch to 
some other way of handling HTTP for this, but I've already done some other implementation that is 
libsoup-based so I'd like to handle this in my code if possible.  

Thanks,
Jon



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]