fix: filters were applied on OPTIOBS
This commit is contained in:
		
							parent
							
								
									3aa0c514a5
								
							
						
					
					
						commit
						3a2677cbe8
					
				
					 4 changed files with 23 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -8,6 +8,12 @@ void valid_json::doFilter(const HttpRequestPtr &req,
 | 
			
		|||
                         FilterCallback &&fcb,
 | 
			
		||||
                         FilterChainCallback &&fccb)
 | 
			
		||||
{
 | 
			
		||||
    if(req->getMethod() == Options)
 | 
			
		||||
    {
 | 
			
		||||
        fccb();
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    Json::Value body = *req->jsonObject();
 | 
			
		||||
 | 
			
		||||
    bool is_valid = true;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,6 +7,11 @@ void json_required::doFilter(const HttpRequestPtr &req,
 | 
			
		|||
                         FilterCallback &&fcb,
 | 
			
		||||
                         FilterChainCallback &&fccb)
 | 
			
		||||
{
 | 
			
		||||
    if(req->getMethod() == Options)
 | 
			
		||||
    {
 | 
			
		||||
        fccb();
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
    // TODO remove this workaround
 | 
			
		||||
 | 
			
		||||
    HttpMethod original_method = req->getMethod();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,6 +8,12 @@ void valid_json::doFilter(const HttpRequestPtr &req,
 | 
			
		|||
                         FilterCallback &&fcb,
 | 
			
		||||
                         FilterChainCallback &&fccb)
 | 
			
		||||
{
 | 
			
		||||
    if(req->getMethod() == Options)
 | 
			
		||||
    {
 | 
			
		||||
        fccb();
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    Json::Value body = *req->jsonObject();
 | 
			
		||||
 | 
			
		||||
    bool is_valid = true;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,6 +7,12 @@ void valid_json::doFilter(const HttpRequestPtr &req,
 | 
			
		|||
                         FilterCallback &&fcb,
 | 
			
		||||
                         FilterChainCallback &&fccb)
 | 
			
		||||
{
 | 
			
		||||
    if(req->getMethod() == Options)
 | 
			
		||||
    {
 | 
			
		||||
        fccb();
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    Json::Value body = *req->jsonObject();
 | 
			
		||||
 | 
			
		||||
    bool is_valid = true;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue