From e06a63c9550add34e139e4423b1a02c37dde5fd6 Mon Sep 17 00:00:00 2001 From: jjs Date: Mon, 23 Jul 2007 23:08:40 +0000 Subject: [PATCH] Fix returned url on successful add_post Maybe fixed error response on failure git-svn-id: file:///home/shish/svn/shimmie2/trunk@362 7f39781d-f577-437e-ae19-be835c7a54ca --- contrib/danbooru_api/main.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/contrib/danbooru_api/main.php b/contrib/danbooru_api/main.php index e693d781..f11b4790 100644 --- a/contrib/danbooru_api/main.php +++ b/contrib/danbooru_api/main.php @@ -7,7 +7,7 @@ simple HTTP GET/POST requests. Author: JJS Notes: danbooru API based on documentation from danbooru 1.0 - http://attachr.com/7569 -I've only been able to test add_post and find_tags beacuse I use the old danbooru firefox extension for firefox 1.5 +I've only been able to test add_post and find_tags because I use the old danbooru firefox extension for firefox 1.5 Functions currently implemented: add_comment - NOT DONE YET, waiting on some backend shimmie code :) @@ -221,11 +221,10 @@ class DanbooruApi extends Extension } else { // If it went ok, grab the id for the newly uploaded image and pass it in the header $newimg = $database->get_image_by_hash($image->hash); - $newid = "http://" . $_SERVER['HTTP_HOST'] . make_link("post/view/" . $newimg->id); + $newid = make_link("post/view/" . $newimg->id); // Did we POST or GET this call? if($_SERVER['REQUEST_METHOD'] == 'POST') { - header("X-You-Win: yes"); header("X-Danbooru-Location: $newid"); } else