hnakamur commented on code in PR #12167:
URL: https://github.com/apache/trafficserver/pull/12167#discussion_r2046733639


##########
include/proxy/hdrs/MIME.h:
##########
@@ -1652,7 +1636,7 @@ MIMEHdr::value_append(const char *name, int name_length, 
const char *value, int
 inline time_t
 MIMEHdr::get_age() const
 {
-  int64_t age = value_get_int64(MIME_FIELD_AGE, MIME_LEN_AGE);
+  int64_t age = value_get_int64(std::string_view{MIME_FIELD_AGE, 
static_cast<std::string_view::size_type>(MIME_LEN_AGE)});

Review Comment:
   I added `c_str_view` which is similar to `std::string_view` but asserts the 
string is terminate with `\0`.
   It is needed in src/api/InkAPIInternal.cc like:
   ```
   TS_MIME_FIELD_ACCEPT                    = MIME_FIELD_ACCEPT.c_str();
   ```
   
   The type of `TS_MIME_FIELD_ACCEPT` is `const char *` and it expected the 
string is terminated with `\0`.
   The type of `MIME_FIELD_ACCEPT` was changed to `c_str_view` which expresses 
so.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to