mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-11-04 09:56:28 +00:00 
			
		
		
		
	Merge #1806
1806: Fix csv content-type error message r=curquiza a=sanders41
Fixes #1805
I was not sure if the `application/csv` [here](23f11e355d/meilisearch-http/tests/content_type.rs (L29)) should also be changed? I'm thinking yes, but `applicaiton/csv` is a bad type.
Co-authored-by: Paul Sanders <psanders1@gmail.com>
			
			
This commit is contained in:
		@@ -181,7 +181,7 @@ async fn document_addition(
 | 
				
			|||||||
        vec![
 | 
					        vec![
 | 
				
			||||||
            "application/json".to_string(),
 | 
					            "application/json".to_string(),
 | 
				
			||||||
            "application/x-ndjson".to_string(),
 | 
					            "application/x-ndjson".to_string(),
 | 
				
			||||||
            "application/csv".to_string(),
 | 
					            "text/csv".to_string(),
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    let format = match content_type {
 | 
					    let format = match content_type {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -124,7 +124,7 @@ async fn add_documents_test_bad_content_types() {
 | 
				
			|||||||
    assert_eq!(
 | 
					    assert_eq!(
 | 
				
			||||||
        response["message"],
 | 
					        response["message"],
 | 
				
			||||||
        json!(
 | 
					        json!(
 | 
				
			||||||
            r#"The Content-Type "text/plain" is invalid. Accepted values for the Content-Type header are: "application/json", "application/x-ndjson", "application/csv""#
 | 
					            r#"The Content-Type "text/plain" is invalid. Accepted values for the Content-Type header are: "application/json", "application/x-ndjson", "text/csv""#
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -142,7 +142,7 @@ async fn add_documents_test_bad_content_types() {
 | 
				
			|||||||
    assert_eq!(
 | 
					    assert_eq!(
 | 
				
			||||||
        response["message"],
 | 
					        response["message"],
 | 
				
			||||||
        json!(
 | 
					        json!(
 | 
				
			||||||
            r#"The Content-Type "text/plain" is invalid. Accepted values for the Content-Type header are: "application/json", "application/x-ndjson", "application/csv""#
 | 
					            r#"The Content-Type "text/plain" is invalid. Accepted values for the Content-Type header are: "application/json", "application/x-ndjson", "text/csv""#
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user