mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-22 00:03:25 -04:00
#get, #set, #clear, that's all you need. this can now be some bespoke custom class implementing these primitives
19 lines
417 B
Ruby
19 lines
417 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative "test"
|
|
|
|
class ResponseCacheServer < TestServer
|
|
class NoCacheApp < WEBrick::HTTPServlet::AbstractServlet
|
|
def do_GET(_req, res) # rubocop:disable Naming/MethodName
|
|
res.status = 200
|
|
res.body = "no-cache"
|
|
res["Cache-Control"] = "private, no-store"
|
|
end
|
|
end
|
|
|
|
def initialize(options = {})
|
|
super
|
|
mount("/no-store", NoCacheApp)
|
|
end
|
|
end
|