Advertisement
AntonyZhilin

Untitled

May 16th, 2024
875
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.10 KB | None | 0 0
  1. MiddlewaresList DefaultPipeline() {
  2.   return {
  3.       // Metrics should go before everything else, basically.
  4.       std::string{"userver-handler-metrics-middleware"},
  5.       // Tracing should go before UnknownExceptionsHandlingMiddleware because it
  6.       // adds some headers, which otherwise might be cleared
  7.       std::string{"userver-tracing-middleware"},
  8.       // Ditto
  9.       std::string{"userver-set-accept-encoding-middleware"},
  10.  
  11.       // Every exception caught here is transformed into Http500 without context
  12.       std::string{"userver-unknown-exceptions-handling-middleware"},
  13.  
  14.       // Should be self-explanatory
  15.       std::string{"userver-rate-limit-middleware"},
  16.       std::string{"userver-deadline-propagation-middleware"},
  17.       std::string{"userver-baggage-middleware"},
  18.       std::string{"userver-auth-middleware"},
  19.       std::string{"userver-decompression-middleware"},
  20.  
  21.       // Transforms CustomHandlerException into response as specified by the
  22.       // exception, transforms std::exception into Http500 without context
  23.       std::string{"userver-exceptions-handling-middleware"},
  24.   };
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement