adding NotAuthorized HTTP response code
This commit is contained in:
parent
cd34f696ce
commit
e36ccb3cfd
3 changed files with 8 additions and 2 deletions
|
|
@ -1,9 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <fc/variant.hpp>
|
#include <fc/variant.hpp>
|
||||||
|
#include <fc/filesystem.hpp>
|
||||||
|
|
||||||
namespace fc
|
namespace fc
|
||||||
{
|
{
|
||||||
class path;
|
|
||||||
class ostream;
|
class ostream;
|
||||||
class buffered_istream;
|
class buffered_istream;
|
||||||
|
|
||||||
|
|
@ -54,7 +54,7 @@ namespace fc
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static void save_to_file( const T& v, const string& p, bool pretty = true )
|
static void save_to_file( const T& v, const std::string& p, bool pretty = true )
|
||||||
{
|
{
|
||||||
save_to_file( variant(v), fc::path(p), pretty );
|
save_to_file( variant(v), fc::path(p), pretty );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,11 @@ struct unsigned_int {
|
||||||
friend bool operator>=( const unsigned_int& i, const unsigned_int& v ) { return v >= i.value; }
|
friend bool operator>=( const unsigned_int& i, const unsigned_int& v ) { return v >= i.value; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief serializes a 32 bit signed interger in as few bytes as possible
|
||||||
|
*
|
||||||
|
* Uses the google protobuf algorithm for seralizing signed numbers
|
||||||
|
*/
|
||||||
struct signed_int {
|
struct signed_int {
|
||||||
signed_int( int32_t v = 0 ):value(v){}
|
signed_int( int32_t v = 0 ):value(v){}
|
||||||
operator int32_t()const { return value; }
|
operator int32_t()const { return value; }
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ namespace fc {
|
||||||
enum status_code {
|
enum status_code {
|
||||||
OK = 200,
|
OK = 200,
|
||||||
RecordCreated = 201,
|
RecordCreated = 201,
|
||||||
|
NotAuthorized = 401,
|
||||||
NotFound = 404,
|
NotFound = 404,
|
||||||
Found = 302,
|
Found = 302,
|
||||||
InternalServerError = 500
|
InternalServerError = 500
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue