@marcel91200 / caddy Mirror · read-only / commits / d7e3a197
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 12, 13:15 UTC

Fix typos (#6311)

* Fix typos * Revert * Revert to "htlm" * fix indentations

Viktor Szépe committed May 10, 2024 at 16:08 UTC d7e3a1974ba968afd84faad207b8717f5faf6ad6
13 files changed +25 -25
.github/CONTRIBUTING.md
+1 -1
@@ -25,7 +25,7 @@ Other menu items:
25
26 You can have a huge impact on the project by helping with its code. To contribute code to Caddy, first submit or comment in an issue to discuss your contribution, then open a [pull request](https://github.com/caddyserver/caddy/pulls) (PR). If you're new to our community, that's okay: **we gladly welcome pull requests from anyone, regardless of your native language or coding experience.** You can get familiar with Caddy's code base by using [code search at Sourcegraph](https://sourcegraph.com/github.com/caddyserver/caddy).
27
28 -We hold contributions to a high standard for quality :bowtie:, so don't be surprised if we ask for revisions—even if it seems small or insignificant. Please don't take it personally. :blue_heart: If your change is on the right track, we can guide you to make it mergable.
28 +We hold contributions to a high standard for quality :bowtie:, so don't be surprised if we ask for revisions—even if it seems small or insignificant. Please don't take it personally. :blue_heart: If your change is on the right track, we can guide you to make it mergeable.
29
30 Here are some of the expectations we have of contributors:
31
caddytest/caddytest.go
+3 -3
@@ -36,7 +36,7 @@ type Defaults struct {
36 // Port we expect caddy to listening on
37 AdminPort int
38 // Certificates we expect to be loaded before attempting to run the tests
39 - Certifcates []string
39 + Certificates []string
40 // TestRequestTimeout is the time to wait for a http request to
41 TestRequestTimeout time.Duration
42 // LoadRequestTimeout is the time to wait for the config to be loaded against the caddy server
@@ -46,7 +46,7 @@ type Defaults struct {
46 // Default testing values
47 var Default = Defaults{
48 AdminPort: 2999, // different from what a real server also running on a developer's machine might be
49 - Certifcates: []string{"/caddy.localhost.crt", "/caddy.localhost.key"},
49 + Certificates: []string{"/caddy.localhost.crt", "/caddy.localhost.key"},
50 TestRequestTimeout: 5 * time.Second,
51 LoadRequestTimeout: 5 * time.Second,
52 }
@@ -231,7 +231,7 @@ const initConfig = `{
231 // designated path and Caddy sub-process is running.
232 func validateTestPrerequisites(t testing.TB) error {
233 // check certificates are found
234 - for _, certName := range Default.Certifcates {
234 + for _, certName := range Default.Certificates {
235 if _, err := os.Stat(getIntegrationDir() + certName); errors.Is(err, fs.ErrNotExist) {
236 return fmt.Errorf("caddy integration test certificates (%s) not found", certName)
237 }
listeners.go
+8 -8
@@ -149,11 +149,11 @@ func (na NetworkAddress) Listen(ctx context.Context, portOffset uint, config net
149
150 func (na NetworkAddress) listen(ctx context.Context, portOffset uint, config net.ListenConfig) (any, error) {
151 var (
152 - ln any
153 - err error
154 - address string
155 - unixFileMode fs.FileMode
156 - isAbtractUnixSocket bool
152 + ln any
153 + err error
154 + address string
155 + unixFileMode fs.FileMode
156 + isAbstractUnixSocket bool
157 )
158
159 // split unix socket addr early so lnKey
@@ -164,7 +164,7 @@ func (na NetworkAddress) listen(ctx context.Context, portOffset uint, config net
164 if err != nil {
165 return nil, err
166 }
167 - isAbtractUnixSocket = strings.HasPrefix(address, "@")
167 + isAbstractUnixSocket = strings.HasPrefix(address, "@")
168 } else {
169 address = na.JoinHostPort(portOffset)
170 }
@@ -172,7 +172,7 @@ func (na NetworkAddress) listen(ctx context.Context, portOffset uint, config net
172 // if this is a unix socket, see if we already have it open,
173 // force socket permissions on it and return early
174 if socket, err := reuseUnixSocket(na.Network, address); socket != nil || err != nil {
175 - if !isAbtractUnixSocket {
175 + if !isAbstractUnixSocket {
176 if err := os.Chmod(address, unixFileMode); err != nil {
177 return nil, fmt.Errorf("unable to set permissions (%s) on %s: %v", unixFileMode, address, err)
178 }
@@ -195,7 +195,7 @@ func (na NetworkAddress) listen(ctx context.Context, portOffset uint, config net
195 }
196
197 if IsUnixNetwork(na.Network) {
198 - if !isAbtractUnixSocket {
198 + if !isAbstractUnixSocket {
199 if err := os.Chmod(address, unixFileMode); err != nil {
200 return nil, fmt.Errorf("unable to set permissions (%s) on %s: %v", unixFileMode, address, err)
201 }
logging.go
+1 -1
@@ -372,7 +372,7 @@ func (cl *BaseLog) provisionCommon(ctx Context, logging *Logging) error {
372 func (cl *BaseLog) buildCore() {
373 // logs which only discard their output don't need
374 // to perform encoding or any other processing steps
375 - // at all, so just shorcut to a nop core instead
375 + // at all, so just shortcut to a nop core instead
376 if _, ok := cl.writerOpener.(*DiscardWriter); ok {
377 cl.core = zapcore.NewNopCore()
378 return
modules/caddyhttp/fileserver/browsetplcontext.go
+1 -1
@@ -132,7 +132,7 @@ type browseTemplateContext struct {
132 // The full path of the request.
133 Path string `json:"path"`
134
135 - // Whether the parent directory is browseable.
135 + // Whether the parent directory is browsable.
136 CanGoUp bool `json:"can_go_up"`
137
138 // The items (files and folders) in the path.
modules/caddyhttp/headers/headers.go
+1 -1
@@ -184,7 +184,7 @@ type RespHeaderOps struct {
184 Require *caddyhttp.ResponseMatcher `json:"require,omitempty"`
185
186 // If true, header operations will be deferred until
187 - // they are written out. Superceded if Require is set.
187 + // they are written out. Superseded if Require is set.
188 // Usually you will need to set this to true if any
189 // fields are being deleted.
190 Deferred bool `json:"deferred,omitempty"`
modules/caddyhttp/ip_matchers.go
+1 -1
@@ -274,7 +274,7 @@ func parseIPZoneFromString(address string) (netip.Addr, string, error) {
274 ipStr = address // OK; probably didn't have a port
275 }
276
277 - // Some IPv6-Adresses can contain zone identifiers at the end,
277 + // Some IPv6-Addresses can contain zone identifiers at the end,
278 // which are separated with "%"
279 zoneID := ""
280 if strings.Contains(ipStr, "%") {
modules/caddyhttp/templates/templates.go
+1 -1
@@ -161,7 +161,7 @@ func init() {
161 // Renders the given Markdown text as HTML and returns it. This uses the
162 // [Goldmark](https://github.com/yuin/goldmark) library,
163 // which is CommonMark compliant. It also has these extensions
164 -// enabled: Github Flavored Markdown, Footnote, and syntax
164 +// enabled: GitHub Flavored Markdown, Footnote, and syntax
165 // highlighting provided by [Chroma](https://github.com/alecthomas/chroma).
166 //
167 // ```
modules/caddytls/automation.go
+1 -1
@@ -97,7 +97,7 @@ type AutomationPolicy struct {
97 SubjectsRaw []string `json:"subjects,omitempty"`
98
99 // The modules that may issue certificates. Default: internal if all
100 - // subjects do not qualify for public certificates; othewise acme and
100 + // subjects do not qualify for public certificates; otherwise acme and
101 // zerossl.
102 IssuersRaw []json.RawMessage `json:"issuers,omitempty" caddy:"namespace=tls.issuance inline_key=module"`
103
modules/caddytls/capools_test.go
+3 -3
@@ -547,7 +547,7 @@ func TestTLSConfig_unmarshalCaddyfile(t *testing.T) {
547 wantErr: true,
548 },
549 {
550 - name: "setting 'ca' without arguemnt is an error",
550 + name: "setting 'ca' without argument is an error",
551 args: args{
552 d: caddyfile.NewTestDispenser(`{
553 ca
@@ -710,7 +710,7 @@ func TestHTTPCertPoolUnmarshalCaddyfile(t *testing.T) {
710 wantErr: false,
711 },
712 {
713 - name: "endpoints defiend inline and in block are merged",
713 + name: "endpoints defined inline and in block are merged",
714 args: args{
715 d: caddyfile.NewTestDispenser(`http http://localhost/ca-certs {
716 endpoints http://remotehost/ca-certs
@@ -722,7 +722,7 @@ func TestHTTPCertPoolUnmarshalCaddyfile(t *testing.T) {
722 wantErr: false,
723 },
724 {
725 - name: "multiple endpoints defiend in block on the same line",
725 + name: "multiple endpoints defined in block on the same line",
726 args: args{
727 d: caddyfile.NewTestDispenser(`http {
728 endpoints http://remotehost/ca-certs http://localhost/ca-certs
modules/caddytls/connpolicy.go
+1 -1
@@ -517,7 +517,7 @@ func (ca *ClientAuthentication) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
517
518 _, ok := unm.(ClientCertificateVerifier)
519 if !ok {
520 - return d.Errf("module '%s' is not a caddytls.ClientCertificatVerifier", modID)
520 + return d.Errf("module '%s' is not a caddytls.ClientCertificateVerifier", modID)
521 }
522 ca.VerifiersRaw = append(ca.VerifiersRaw, caddyconfig.JSONModuleObject(unm, "verifier", vType, nil))
523 default:
modules/caddytls/internalissuer.go
+1 -1
@@ -94,7 +94,7 @@ func (iss *InternalIssuer) Provision(ctx caddy.Context) error {
94 }
95
96 // IssuerKey returns the unique issuer key for the
97 -// confgured CA endpoint.
97 +// configured CA endpoint.
98 func (iss InternalIssuer) IssuerKey() string {
99 return iss.ca.ID
100 }
modules/caddytls/matchers.go
+2 -2
@@ -110,7 +110,7 @@ func (m MatchRemoteIP) Match(hello *tls.ClientHelloInfo) bool {
110 }
111 ipAddr, err := netip.ParseAddr(ipStr)
112 if err != nil {
113 - m.logger.Error("invalid client IP addresss", zap.String("ip", ipStr))
113 + m.logger.Error("invalid client IP address", zap.String("ip", ipStr))
114 return false
115 }
116 return (len(m.cidrs) == 0 || m.matches(ipAddr, m.cidrs)) &&
@@ -185,7 +185,7 @@ func (m MatchLocalIP) Match(hello *tls.ClientHelloInfo) bool {
185 }
186 ipAddr, err := netip.ParseAddr(ipStr)
187 if err != nil {
188 - m.logger.Error("invalid local IP addresss", zap.String("ip", ipStr))
188 + m.logger.Error("invalid local IP address", zap.String("ip", ipStr))
189 return false
190 }
191 return (len(m.cidrs) == 0 || m.matches(ipAddr, m.cidrs))