You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by "ocket8888 (via GitHub)" <gi...@apache.org> on 2023/02/07 20:44:06 UTC

[GitHub] [trafficcontrol] ocket8888 opened a new pull request, #7344: TPv2 Date Revival

ocket8888 opened a new pull request, #7344:
URL: https://github.com/apache/trafficcontrol/pull/7344

   This PR adds an HTTP interceptor to TPv2 that parses JSON responses with a special "reviver" function that converts strings-representing-dates into actual `Date` instances. This eliminates the need to do so by hand e.g.
   
   ```typescript
   const resp = await this.get<MyType>("my/type");
   return resp.map(
       m => ({...m, lastUpdated: new Date((m.lastUpdated as unknown as string).replace(" ", "T").replace("+00", "Z"))})
   );
   ```
   
   <hr/>
   
   ## Which Traffic Control components are affected by this PR?
   - Traffic Portal (experimental v2)
   
   ## What is the best way to verify this PR?
   Make sure the provided tests pass.
   
   ## PR submission checklist
   - [x] This PR has tests
   - [x] This PR doesn't need documentation
   - [x] This PR doesn't need a CHANGELOG.md entry 
   - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY**


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficcontrol] shamrickus merged pull request #7344: TPv2 Date Revival

Posted by "shamrickus (via GitHub)" <gi...@apache.org>.
shamrickus merged PR #7344:
URL: https://github.com/apache/trafficcontrol/pull/7344


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org