implement xml response for legacy post create action
This commit is contained in:
@@ -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
|
||||
|
||||
4
app/views/legacy/create_post.xml.erb
Normal file
4
app/views/legacy/create_post.xml.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
<response>
|
||||
<post_id>0</post_id>
|
||||
<location>http://<%= Danbooru.config.hostname %>/uploads/<%= @upload.id %></location>
|
||||
</response>
|
||||
@@ -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]}"}
|
||||
|
||||
Reference in New Issue
Block a user