Sha256: e58579010fded9de1358082cba74f84f644fce2f5b265a679b94ae16518aae68

Contents?: true

Size: 1.23 KB

Versions: 15

Compression:

Stored size: 1.23 KB

Contents

# frozen_string_literal: true

#--
# Yast rake
#
# Copyright (C) 2020, SUSE LLC
#   This library is free software; you can redistribute it and/or modify
# it only under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
#   This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
#   You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#++

require "webrick"

module Yast
  # a webrick servlet which returns a basic HTML info about the server,
  # just to avoid that nasty 404 error page when someone opens the
  # server URL in a web browser
  class IndexServlet < WEBrick::HTTPServlet::AbstractServlet
    INDEX_FILE = File.expand_path("../../data/index.html", __dir__)

    def do_GET(_request, response)
      response.status = 200
      response.content_type = "text/html"
      response.body = File.read(INDEX_FILE)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
yast-rake-0.2.51 lib/yast/index_servlet.rb
yast-rake-0.2.50 lib/yast/index_servlet.rb
yast-rake-0.2.49 lib/yast/index_servlet.rb
yast-rake-0.2.48 lib/yast/index_servlet.rb
yast-rake-0.2.47 lib/yast/index_servlet.rb
yast-rake-0.2.46 lib/yast/index_servlet.rb
yast-rake-0.2.45 lib/yast/index_servlet.rb
yast-rake-0.2.44 lib/yast/index_servlet.rb
yast-rake-0.2.43 lib/yast/index_servlet.rb
yast-rake-0.2.42 lib/yast/index_servlet.rb
yast-rake-0.2.41 lib/yast/index_servlet.rb
yast-rake-0.2.40 lib/yast/index_servlet.rb
yast-rake-0.2.39 lib/yast/index_servlet.rb
yast-rake-0.2.38 lib/yast/index_servlet.rb
yast-rake-0.2.37 lib/yast/index_servlet.rb