session_shared: close in ~BackendInstance MP-549
[metaproxy-moved-to-github.git] / src / filter_http_file.cpp
index 64efa72..18bdd57 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of Metaproxy.
-   Copyright (C) 2005-2013 Index Data
+   Copyright (C) Index Data
 
 Metaproxy is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
@@ -138,6 +138,13 @@ void yf::HttpFile::Rep::fetch_file(mp::Session &session,
 {
     mp::odr o(ODR_ENCODE);
 
+    if (strcmp(req->method, "GET"))
+    {
+        Z_GDU *gdu = o.create_HTTP_Response(session, req, 405);
+        package.response() = gdu;
+        return;
+    }
+
     FILE *f = fopen(fname.c_str(), "rb");
     if (!f)
     {