Unhandled HTTP request is turned in to HTTP response 500 (server error).
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 28 May 2008 15:13:39 +0000 (17:13 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 28 May 2008 15:13:39 +0000 (17:13 +0200)
src/filter_frontend_net.cpp

index 1bee3cd..f2e0b88 100644 (file)
@@ -148,8 +148,18 @@ void mp::ThreadPoolPackage::result()
                 "unhandled Z39.50 request");
 
             m_session->send_Z_PDU(apdu_response, &len);
-            m_package->session().close();
         }
+        else if (z_gdu && z_gdu->which == Z_GDU_HTTP_Request)
+        {
+            // For HTTP, respond with Server Error
+            int len;
+            mp::odr odr;
+            Z_GDU *zgdu_res 
+                = odr.create_HTTP_Response(m_package->session(), 
+                                           z_gdu->u.HTTP_Request, 500);
+            m_session->send_GDU(zgdu_res, &len);
+        }
+        m_package->session().close();
     }
 
     if (m_session->m_no_requests == 0 && m_package->session().is_closed())