google / addlicense

A program which ensures source code files have copyright license headers by scanning directory patterns recursively

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why use http:// for Apache 2.0 License

ahmetb opened this issue · comments

This tool right now adds a link with http:// for Apache 2.0 license

// Copyright 2021 Google LLC
//
// Licensed 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.

but some of our internal tests check for https://. https://github.com/GoogleCloudPlatform/golang-samples/blob/73d60a5de091dcdda5e4f753b594ef18eee67906/license_test.go#L32

I know the license text itself uses http:// to apply the license, but should we switch to https://?

Since the test you reference there is using a regex, it should be trivial to mark the "s" as optional. That will likely be the safest option, since I suspect most people are using the exact text from https://www.apache.org/licenses/LICENSE-2.0.txt, which is "http".