From 151d0baa9420feda02d8f82ee2a355885a62333e Mon Sep 17 00:00:00 2001
From: Matthew Holt <mholt@users.noreply.github.com>
Date: Tue, 23 Aug 2016 15:47:23 -0600
Subject: [PATCH] Minor text fixes ;)

---
 CONTRIBUTING.md             | 3 ++-
 README.md                   | 2 +-
 caddyhttp/redirect/setup.go | 2 +-
 caddytls/config.go          | 3 +++
 caddytls/crypto.go          | 5 +++++
 5 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 570ca7f11..ea3271bc9 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -65,7 +65,8 @@ Don't worry, that won't happen without an open discussion first.
 
 If you are going to spend significant time writing code for a new pull request,
 best to open an issue to "claim" it and get feedback before you invest a lot of
-time.
+time. Not all pull requests are merged, and that's okay.
+[Read why.](https://github.com/turbolinks/turbolinks/pull/124#issuecomment-239826060)
 
 Remember: pull requests should always be thoroughly documented both via godoc
 and with at least a rough draft of documentation that might go on the website
diff --git a/README.md b/README.md
index 2c5d41cfb..38e432d76 100644
--- a/README.md
+++ b/README.md
@@ -99,7 +99,7 @@ Note: You will need **[Go 1.6](https://golang.org/dl/)** or newer.
 
 1. `go get github.com/mholt/caddy/caddy`
 2. `cd` into your website's directory
-3. Run `caddy` (assumes `$GOPATH/bin` is in your `$PATH`)
+3. Run `caddy` (assuming `$GOPATH/bin` is in your `$PATH`)
 
 Caddy's `main()` is in the caddy subfolder. To recompile Caddy, use
 `build.bash` found in that folder.
diff --git a/caddyhttp/redirect/setup.go b/caddyhttp/redirect/setup.go
index 1a97ffefa..da797ab0b 100644
--- a/caddyhttp/redirect/setup.go
+++ b/caddyhttp/redirect/setup.go
@@ -165,5 +165,5 @@ var httpRedirs = map[string]int{
 	"304": http.StatusNotModified,
 	"305": http.StatusUseProxy,
 	"307": http.StatusTemporaryRedirect,
-	"308": 308, // Permanent Redirect
+	"308": 308, // Permanent Redirect (RFC 7238)
 }
diff --git a/caddytls/config.go b/caddytls/config.go
index cef90aa36..f0f234b63 100644
--- a/caddytls/config.go
+++ b/caddytls/config.go
@@ -130,6 +130,9 @@ func (c *Config) ObtainCert(allowPrompts bool) error {
 	return c.obtainCertName(c.Hostname, allowPrompts)
 }
 
+// obtainCertName gets a certificate for name using the ACME config c
+// if c and name both qualify. It places the certificate in storage.
+// It is a no-op if the storage already has a certificate for name.
 func (c *Config) obtainCertName(name string, allowPrompts bool) error {
 	if !c.Managed || !HostQualifies(name) {
 		return nil
diff --git a/caddytls/crypto.go b/caddytls/crypto.go
index 347f969ca..65b10de3c 100644
--- a/caddytls/crypto.go
+++ b/caddytls/crypto.go
@@ -106,6 +106,11 @@ func stapleOCSP(cert *Certificate, pemBundle []byte) error {
 			}
 		} else {
 			// invalid contents; delete the file
+			// (we do this independently of the maintenance routine because
+			// in this case we know for sure this should be a staple file
+			// because we loaded it by name, whereas the maintenance routine
+			// just iterates the list of files, even if somehow a non-staple
+			// file gets in the folder. in this case we are sure it is corrupt.)
 			err := os.Remove(ocspCachePath)
 			if err != nil {
 				log.Printf("[WARNING] Unable to delete invalid OCSP staple file: %v", err)