implement xml response for legacy post create action

This commit is contained in:
albert
2013-02-20 01:23:08 -05:00
parent 42adf0fd15
commit 5f6cb744a3
3 changed files with 5 additions and 2 deletions

View File

@@ -9,7 +9,6 @@ class LegacyController < ApplicationController
def create_post
@upload = Upload.create(params[:post].merge(:server => Socket.gethostname))
@upload.delay.process!
render :nothing => true
end
def users

View File

@@ -0,0 +1,4 @@
<response>
<post_id>0</post_id>
<location>http://<%= Danbooru.config.hostname %>/uploads/<%= @upload.id %></location>
</response>

View File

@@ -223,7 +223,7 @@ Danbooru::Application.routes.draw do
match "/post/index.xml", :controller => "legacy", :action => "posts", :format => "xml"
match "/post/index.json", :controller => "legacy", :action => "posts", :format => "json"
match "/post/create.xml", :controller => "legacy", :action => "create_post"
match "/post/create.xml", :controller => "legacy", :action => "create_post", :format => "xml"
match "/post/piclens", :controller => "legacy", :action => "unavailable"
match "/post/index" => redirect {|params, req| "/posts?tags=#{CGI::escape(req.params[:tags].to_s)}&page=#{req.params[:page]}"}
match "/post" => redirect {|params, req| "/posts?tags=#{CGI::escape(req.params[:tags].to_s)}&page=#{req.params[:page]}"}