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 2021/02/17 21:58:29 UTC

[GitHub] [trafficcontrol] jehunte opened a new pull request #5537: update sc header rewrite logic

jehunte opened a new pull request #5537:
URL: https://github.com/apache/trafficcontrol/pull/5537


   ## What does this PR (Pull Request) do?
   - This PR correctly sets the ATS header when a service category is assigned to a delivery service
   - Tests are not necessary for this pr because there are already tests in headerrewritedotconfig_test.go checking that this header gets added to the string
   
   - [x] This PR is not related to any Issue
   
   ## Which Traffic Control components are affected by this PR?
   
   - Traffic Ops ORT
   - Documentation is not required because it fixes a bug with the existing implementation. Documentation is already in place for the functionality of the feature.
   
   ## What is the best way to verify this PR?
   - Check the traffic server hdr_wr config file contains the correct headers/rewrite string
   
   ## If this is a bug fix, what versions of Traffic Control are affected?
   - master 
   - 5.x.x
   
   ## The following criteria are ALL met by this PR
   <!-- Check the boxes to signify that the associated statement is true. To
   "check a box", replace the space inside of the square brackets with an 'x'.
   e.g.
   
   - [ x] <- Wrong
   - [x ] <- Wrong
   - [] <- Wrong
   - [*] <- Wrong
   - [x] <- Correct!
   
   -->
   
   - [x] This PR includes tests OR I have explained why tests are unnecessary
   - [x] This PR includes documentation OR I have explained why documentation is unnecessary
   - [x] This PR includes an update to CHANGELOG.md OR such an update is not necessary
   - [x] This PR includes any and all required license headers
   - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://www.apache.org/security/) for details)
   
   
   <!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
   
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
   -->
   


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



[GitHub] [trafficcontrol] rob05c edited a comment on pull request #5537: update service category header rewrite logic

Posted by GitBox <gi...@apache.org>.
rob05c edited a comment on pull request #5537:
URL: https://github.com/apache/trafficcontrol/pull/5537#issuecomment-780903103






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



[GitHub] [trafficcontrol] rob05c commented on pull request #5537: update service category header rewrite logic

Posted by GitBox <gi...@apache.org>.
rob05c commented on pull request #5537:
URL: https://github.com/apache/trafficcontrol/pull/5537#issuecomment-780903103


   So, I'm noticing the `set-header` logic doesn't add its own hook. Which means it's going to fall under whatever the last hook happens to be, which may be a response rather than request hook, or it could be an error if there's no MaxOriginConnections or EdgeHeaderRewrite.
   
   I'm also noticing the CDN-SVC header isn't in `topologyheaderrewritedotconfig.go`, so it won't be added for Topology DSes.
   
   This PR doesn't introduce either of those issues, so I wouldn't insist it fix them. If you want to, that'd be great, or if not, whoever merges this should make Github Issues so we don't forget.


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



[GitHub] [trafficcontrol] rob05c edited a comment on pull request #5537: update service category header rewrite logic

Posted by GitBox <gi...@apache.org>.
rob05c edited a comment on pull request #5537:
URL: https://github.com/apache/trafficcontrol/pull/5537#issuecomment-780903103


   So, I'm noticing the `set-header` logic doesn't add its own hook. Which means it's going to fall under whatever the last hook happens to be, which may be a response rather than request hook, or it could be an error if there's no MaxOriginConnections or EdgeHeaderRewrite. 
   
   I think it needs to add its own hook like the MaxOriginConnections logic does above, i.e. `cond %{REMAP_PSEUDO_HOOK}\nset-header ...`
   
   I'm also noticing the CDN-SVC header isn't in `topologyheaderrewritedotconfig.go`, so it won't be added for Topology DSes.
   
   This PR doesn't introduce either of those issues, so I wouldn't insist it fix them. If you want to, that'd be great, or if not, whoever merges this should make Github Issues so we don't forget.


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



[GitHub] [trafficcontrol] rawlinp commented on pull request #5537: update service category header rewrite logic

Posted by GitBox <gi...@apache.org>.
rawlinp commented on pull request #5537:
URL: https://github.com/apache/trafficcontrol/pull/5537#issuecomment-801449239


   Should we add this to the 5.1.1 milestone?


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



[GitHub] [trafficcontrol] rob05c commented on a change in pull request #5537: update service category header rewrite logic

Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #5537:
URL: https://github.com/apache/trafficcontrol/pull/5537#discussion_r577982800



##########
File path: lib/go-atscfg/headerrewritedotconfig.go
##########
@@ -35,7 +35,7 @@ const HeaderRewritePrefix = "hdr_rw_"
 const ContentTypeHeaderRewriteDotConfig = ContentTypeTextASCII
 const LineCommentHeaderRewriteDotConfig = LineCommentHash
 
-const ServiceCategoryHeader = "CDN-SVC"
+const ServiceCategoryHeader = "X-CDN-SVC"

Review comment:
       Why `X-`? 
   
   The IETF has asked people to stop prefixing headers with `X-` because it makes it hard to remove in a standard later when they become common: https://tools.ietf.org/html/rfc6648




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



[GitHub] [trafficcontrol] jehunte commented on pull request #5537: update service category header rewrite logic

Posted by GitBox <gi...@apache.org>.
jehunte commented on pull request #5537:
URL: https://github.com/apache/trafficcontrol/pull/5537#issuecomment-802187605


   > Should we add this to the 5.1.1 milestone?
   
   That would be great! @rob05c and I chatted about his comments and that will need to be added for the release too. It should be pretty straight forward. He was going to take a look at this stuff but I'm not sure where that falls on his list of priorities. Rob do you think this will be ready for the 5.1.1 milestone?


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



[GitHub] [trafficcontrol] rob05c merged pull request #5537: update service category header rewrite logic

Posted by GitBox <gi...@apache.org>.
rob05c merged pull request #5537:
URL: https://github.com/apache/trafficcontrol/pull/5537


   


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



[GitHub] [trafficcontrol] rob05c commented on pull request #5537: update service category header rewrite logic

Posted by GitBox <gi...@apache.org>.
rob05c commented on pull request #5537:
URL: https://github.com/apache/trafficcontrol/pull/5537#issuecomment-802190129


   @jehunte I'm not sure what the timeline on 5.1.1 is, but yeah, I think this plus #5641 should go in it, if possible. If it's more than a week or so, there are a list of ORT fixes and features that should go in. I'll add the `5.1.1` tag to them all, and people can remove if necessary


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