Class: Hawkins::Commands::LiveServe::ReloadServlet

Inherits:
Jekyll::Commands::Serve::Servlet
  • Object
show all
Defined in:
lib/hawkins/servlet.rb

Instance Method Summary collapse

Instance Method Details

#do_GET(req, res) ⇒ Object

rubocop:disable MethodName



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/hawkins/servlet.rb', line 133

def do_GET(req, res) # rubocop:disable MethodName
  rtn = super
  return rtn if SkipAnalyzer.skip_processing?(req, res, @jekyll_opts)

  processor = BodyProcessor.new(res.body, @jekyll_opts)
  processor.process!
  res.body = processor.new_body
  res.content_length = processor.content_length.to_s

  if processor.livereload_added
    res['X-Rack-LiveReload'] = '1'
  end

  rtn
end