rob05c commented on a change in pull request #3023: WIP Supported routes fetch URL: https://github.com/apache/trafficcontrol/pull/3023#discussion_r233241359
########## File path: traffic_ops/traffic_ops_golang/api/api_route.go ########## @@ -0,0 +1,148 @@ +package api + +/* + * 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. + */ + +import "bytes" +import "net/http" +import "regexp" +import "strconv" +//import trops "github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang" +import log "github.com/apache/trafficcontrol/lib/go-log" + +// todo - make the version string modular and accessible everywhere +const ServerString = "Traffic Operations/3.0.0"; Review comment: Yes. For debugging and diagnosing problems, we look for `X-Server-Name` to indicate a response was sent by Go, and `Server` to indicate a response was sent by Mojo/Perl. Specifically, when `traffic_ops_golang` reverse-proxies Perl, it doesn't set `X-Server-Name`, and that's the _only_ time it doesn't set it. If we set `Server` in Go, you couldn't be 100% certain that a response with that header wasn't served by Mojo, and then accidentally overwritten by Go. As long as we have both Perl and Go, it makes finding issues easier to have a unique header for each, that the other never serves. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
