You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2020/04/22 18:51:04 UTC

[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #4657: Allow support for "If-Modified-Since" on GET requests

ocket8888 commented on a change in pull request #4657:
URL: https://github.com/apache/trafficcontrol/pull/4657#discussion_r413234348



##########
File path: traffic_ops/traffic_ops_golang/apitenant/tenant.go
##########
@@ -122,7 +123,18 @@ func (ten TOTenant) Validate() error {
 
 func (tn *TOTenant) Create() (error, error, int) { return api.GenericCreate(tn) }
 
-func (ten *TOTenant) Read() ([]interface{}, error, error, int) {
+func (ten *TOTenant) Read(h map[string][]string) ([]interface{}, error, error, int) {
+	ims := h["If-Modified-Since"]
+	var modifiedSince time.Time
+	modified := false
+	found := false
+	code := http.StatusOK
+
+	if ims != nil && len(ims) != 0 {
+		if t, err := time.Parse(time.RFC1123, ims[0]); err == nil {

Review comment:
       > _"Which should probably be moved to `lib/go-rfc`"_
   
   :+1: 




----------------------------------------------------------------
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.

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