Seastar
High performance C++ framework for concurrent servers
Public Member Functions | List of all members
seastar::httpd::content_replace Class Reference

Detailed Description

content_replace replaces variable in a file with a dynamic value. It would take the host from request and will replace the variable in a file

The replacement can be restricted to an extension.

We are currently support only one file type for replacement. It could be extend if we will need it

#include <seastar/http/transformers.hh>

Inheritance diagram for seastar::httpd::content_replace:
seastar::httpd::file_transformer

Public Member Functions

virtual output_stream< char > transform (std::unique_ptr< http::request > req, const sstring &extension, output_stream< char > &&s)
 
 content_replace (const sstring &extension="")
 

Constructor & Destructor Documentation

◆ content_replace()

seastar::httpd::content_replace::content_replace ( const sstring &  extension = "")
inlineexplicit

the constructor get the file extension the replace would work on.

Parameters
extensionfile extension, when not set all files extension

Member Function Documentation

◆ transform()

virtual output_stream<char> seastar::httpd::content_replace::transform ( std::unique_ptr< http::request req,
const sstring &  extension,
output_stream< char > &&  s 
)
virtual

Any file transformer should implement this method.

Parameters
reqthe request
extensionthe file extension originating the content returns a new output stream to be used when writing the file to the reply

Implements seastar::httpd::file_transformer.


The documentation for this class was generated from the following file: