Skip to content

Commit

Permalink
Fix inference header handling for Vertex and SageMaker (triton-infere…
Browse files Browse the repository at this point in the history
…nce-server#4099)

* Fix inference header handling for Vertex and SageMaker

* Fix copyright
  • Loading branch information
GuanLuo committed Mar 24, 2022
1 parent bc66e6b commit 13bf2ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/sagemaker_server.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// Copyright 2021-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -34,8 +34,9 @@ TRITONSERVER_Error*
SagemakerAPIServer::GetInferenceHeaderLength(
evhtp_request_t* req, int32_t content_length, size_t* header_length)
{
// Check mime type and set inference header length. If missing set to 0
*header_length = 0;
// Check mime type and set inference header length.
// Set to content length in case that it is not specified
*header_length = content_length;
const char* content_type_c_str =
evhtp_kv_find(req->headers_in, kContentTypeHeader);
if (content_type_c_str != NULL) {
Expand Down
7 changes: 4 additions & 3 deletions src/vertex_ai_server.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// Copyright 2021-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -52,8 +52,9 @@ TRITONSERVER_Error*
VertexAiAPIServer::GetInferenceHeaderLength(
evhtp_request_t* req, int32_t content_length, size_t* header_length)
{
// Check mime type and set inference header length. If missing set to 0
*header_length = 0;
// Check mime type and set inference header length.
// Set to content length in case that it is not specified
*header_length = content_length;
const char* content_type_c_str =
evhtp_kv_find(req->headers_in, kContentTypeHeader);
if (content_type_c_str != NULL) {
Expand Down

0 comments on commit 13bf2ee

Please sign in to comment.