lib/shogun/server.rb in shogun-3.1.0 vs lib/shogun/server.rb in shogun-3.2.0
- old
+ new
@@ -2,11 +2,11 @@
module Server
def serve
@rack.use(Rack::Log, @logger)
@rack.use(Rack::Runtime)
@rack.use(Rack::Protection::RemoteReferrer)
- @rack.use(Rack::Protection::HttpOrigin)
+ @rack.use(Rack::Protection::HttpOrigin, origin_whitelist: origin_whitelist)
@rack.use(Rack::Protection::EscapedParams)
@rack.use(Rack::Protection::XSSHeader)
@rack.use(Rack::Protection::FrameOptions)
@rack.use(Rack::Protection::PathTraversal)
@rack.use(Rack::Protection::IPSpoofing)
@@ -46,8 +46,12 @@
self.class.const_get("ACCEPT_TYPES")
end
private def cors
self.class.const_get("CORS")
+ end
+
+ private def origin_whitelist
+ self.class.const_get("ORIGIN_WHITELIST")
end
end
end