]> dev.renevier.net Git - syj.git/blobdiff - application/controllers/GeomController.php
exported path: use title instead of idx for filename
[syj.git] / application / controllers / GeomController.php
index 1a860b66c968e4eaeb9805037a1698ea1237f63a..b01837c8c50c218e20cb452c59ffc6ff3bebe4dc 100644 (file)
@@ -28,12 +28,14 @@ class GeomController extends Zend_Controller_Action
         }
 
         if (!$pathMapper->find($idx, $path)) {
-            if ($pathMapper->hasexisted($idx)) {
-                $api->setCode(410);
-            } else {
-                $api->setCode(404);
+            if (!$pathMapper->findByTitle($idx, $path)) {
+                if ($pathMapper->hasexisted($idx)) {
+                    $api->setCode(410);
+                } else {
+                    $api->setCode(404);
+                }
+                return;
             }
-            return;
         }
 
         switch ($ext) {
@@ -82,7 +84,7 @@ class GeomController extends Zend_Controller_Action
         $data .= '</gpx>';
 
         $api = $this->_helper->SyjApi;
-        $api->setCheckIfNoneMatch(true)->setContentType('application/octet-stream')->setBody($data);
+        $api->setCheckIfNoneMatch(true)->setContentType('application/gpx+xml')->setBody($data);
     }
 
     protected function json(Syj_Model_Path $path) {