test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/NanoHTTPD.java in calabash-android-0.4.7.pre2 vs test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/NanoHTTPD.java in calabash-android-0.4.7.pre3
- old
+ new
@@ -358,12 +358,16 @@
// in data section, too, read it:
if ( method.equalsIgnoreCase( "POST" ))
{
String contentType = "";
String contentTypeHeader = header.getProperty("content-type");
- StringTokenizer st = new StringTokenizer( contentTypeHeader , "; " );
- if ( st.hasMoreTokens()) {
- contentType = st.nextToken();
+
+ StringTokenizer st = null;
+ if (contentTypeHeader != null) {
+ st = new StringTokenizer(contentTypeHeader, ",; ");
+ if (st.hasMoreTokens()) {
+ contentType = st.nextToken();
+ }
}
if (contentType.equalsIgnoreCase("multipart/form-data"))
{
// Handle multipart/form-data