source: subversion/utils/little-osm/tools.rb @ 1168

Last change on this file since 1168 was 1168, checked in by imi, 14 years ago

fixed little-osm. It is usable together with JOSM again.

File size: 501 bytes
Line 
1def ok
2  print "HTTP/1.1 200/OK\r\nServer: little-osm\r\nContent-type: text/plain\r\n\r\n"
3end
4
5def header
6  print "<?xml version='1.0' encoding='UTF-8'?>\n<osm version='0.3' generator='little-osm'>"
7end
8
9def bad_request reason = "Bad Request"
10  print "HTTP/1.1 400/#{reason}\r\n\r\n"
11  throw :little_osm_done
12end
13
14# return the queries as hash
15def get_queries
16  arr = Thread.current['uri'].query.split('&').collect do |x| x.split "=" end
17  q = {}
18  arr.each do |x| q[x[0]] = (x[1] ||= "") end
19  q
20end
Note: See TracBrowser for help on using the repository browser.