Sha256: f3c8f3049704ada8b21d6605f638bb798de6666492154899d24e0f3dad775e5c
Contents?: true
Size: 895 Bytes
Versions: 5
Compression:
Stored size: 895 Bytes
Contents
require 'faraday_middleware/response_middleware' module FaradayMiddleware # Public: Parse response bodies as YAML. # # Warning: this uses `YAML.load()` by default and as such is not safe against # code injection or DoS attacks. If you're loading resources from an # untrusted host or over HTTP, you should subclass this middleware and # redefine it to use `safe_load()` if you're using a Psych version that # supports it: # # class SafeYaml < FaradayMiddleware::ParseYaml # define_parser do |body| # YAML.safe_load(body) # end # end # # Faraday.new(..) do |config| # config.use SafeYaml # ... # end class ParseYaml < ResponseMiddleware dependency 'yaml' define_parser do |body| ::YAML.load body end end end # deprecated alias Faraday::Response::ParseYaml = FaradayMiddleware::ParseYaml
Version data entries
5 entries across 5 versions & 2 rubygems