Skip to content

Commit ece420c

Browse files
authored
chore: fix typos (#1328)
* Fix typos * Fix indentation
1 parent 2f4c831 commit ece420c

7 files changed

Lines changed: 17 additions & 17 deletions

File tree

caddy/caddy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ func TestAllDefinedServerVars(t *testing.T) {
608608
"Content-Type: application/x-www-form-urlencoded",
609609
"Content-Length: 14", // maliciously set to 14
610610
"Special-Chars: <%00>",
611-
"Host: Malicous Host",
611+
"Host: Malicious Host",
612612
"X-Empty-Header:",
613613
},
614614
bytes.NewBufferString("foo=bar"),

docs/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ FROM dunglas/frankenphp
1919
# Production:
2020
RUN cp $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini
2121

22-
# Or developement:
22+
# Or development:
2323
RUN cp $PHP_INI_DIR/php.ini-development $PHP_INI_DIR/php.ini
2424
```
2525

docs/production.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Refer to "[Building Custom Docker Image](docker.md)" for more details and option
3131
and to learn how to customize the configuration, install PHP extensions and Caddy modules.
3232

3333
If your project uses Composer,
34-
be sure to include it in the Docker image and to install your depedencies.
34+
be sure to include it in the Docker image and to install your dependencies.
3535

3636
Then, add a `compose.yaml` file:
3737

frankenphp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ PHP_FUNCTION(frankenphp_handle_request) {
431431
}
432432

433433
/*
434-
* If an exception occured, print the message to the client before closing the
434+
* If an exception occurred, print the message to the client before closing the
435435
* connection
436436
*/
437437
if (EG(exception)) {

frankenphp_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// In all tests, headers added to requests are copied on the heap using strings.Clone.
22
// This was originally a workaround for https://github.com/golang/go/issues/65286#issuecomment-1920087884 (fixed in Go 1.22),
3-
// but this allows to catch panics occuring in real life but not when the string is in the internal binary memory.
3+
// but this allows to catch panics occurring in real life but not when the string is in the internal binary memory.
44

55
package frankenphp_test
66

@@ -41,7 +41,7 @@ type testOptions struct {
4141
watch []string
4242
nbWorkers int
4343
env map[string]string
44-
nbParrallelRequests int
44+
nbParallelRequests int
4545
realServer bool
4646
logger *zap.Logger
4747
initOpts []frankenphp.Option
@@ -51,8 +51,8 @@ func runTest(t *testing.T, test func(func(http.ResponseWriter, *http.Request), *
5151
if opts == nil {
5252
opts = &testOptions{}
5353
}
54-
if opts.nbParrallelRequests == 0 {
55-
opts.nbParrallelRequests = 100
54+
if opts.nbParallelRequests == 0 {
55+
opts.nbParallelRequests = 100
5656
}
5757

5858
cwd, _ := os.Getwd()
@@ -87,8 +87,8 @@ func runTest(t *testing.T, test func(func(http.ResponseWriter, *http.Request), *
8787
}
8888

8989
var wg sync.WaitGroup
90-
wg.Add(opts.nbParrallelRequests)
91-
for i := 0; i < opts.nbParrallelRequests; i++ {
90+
wg.Add(opts.nbParallelRequests)
91+
for i := 0; i < opts.nbParallelRequests; i++ {
9292
go func(i int) {
9393
test(handler, ts, i)
9494
wg.Done()
@@ -850,7 +850,7 @@ func BenchmarkServerSuperGlobal(b *testing.B) {
850850
cwd, _ := os.Getwd()
851851
testDataDir := cwd + "/testdata/"
852852

853-
// Mimicks headers of a request sent by Firefox to GitHub
853+
// Mimics headers of a request sent by Firefox to GitHub
854854
headers := http.Header{}
855855
headers.Add(strings.Clone("Accept"), strings.Clone("text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"))
856856
headers.Add(strings.Clone("Accept-Encoding"), strings.Clone("gzip, deflate, br"))

watcher_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func TestWorkersShouldReloadOnMatchingPattern(t *testing.T) {
2929
runTest(t, func(handler func(http.ResponseWriter, *http.Request), _ *httptest.Server, i int) {
3030
requestBodyHasReset := pollForWorkerReset(t, handler, maxTimesToPollForChanges)
3131
assert.True(t, requestBodyHasReset)
32-
}, &testOptions{nbParrallelRequests: 1, nbWorkers: 1, workerScript: "worker-with-watcher.php", watch: watch})
32+
}, &testOptions{nbParallelRequests: 1, nbWorkers: 1, workerScript: "worker-with-watcher.php", watch: watch})
3333
}
3434

3535
func TestWorkersShouldNotReloadOnExcludingPattern(t *testing.T) {
@@ -38,7 +38,7 @@ func TestWorkersShouldNotReloadOnExcludingPattern(t *testing.T) {
3838
runTest(t, func(handler func(http.ResponseWriter, *http.Request), _ *httptest.Server, i int) {
3939
requestBodyHasReset := pollForWorkerReset(t, handler, minTimesToPollForChanges)
4040
assert.False(t, requestBodyHasReset)
41-
}, &testOptions{nbParrallelRequests: 1, nbWorkers: 1, workerScript: "worker-with-watcher.php", watch: watch})
41+
}, &testOptions{nbParallelRequests: 1, nbWorkers: 1, workerScript: "worker-with-watcher.php", watch: watch})
4242
}
4343

4444
func fetchBody(method string, url string, handler func(http.ResponseWriter, *http.Request)) string {

worker_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ func TestWorker(t *testing.T) {
4343
body2, _ := io.ReadAll(resp2.Body)
4444

4545
assert.Contains(t, string(body2), fmt.Sprintf("Requests handled: %d", i*2+1))
46-
}, &testOptions{workerScript: "worker.php", nbWorkers: 1, nbParrallelRequests: 1})
46+
}, &testOptions{workerScript: "worker.php", nbWorkers: 1, nbParallelRequests: 1})
4747
}
4848

4949
func TestWorkerDie(t *testing.T) {
5050
runTest(t, func(handler func(http.ResponseWriter, *http.Request), _ *httptest.Server, i int) {
5151
req := httptest.NewRequest("GET", "http://example.com/die.php", nil)
5252
w := httptest.NewRecorder()
5353
handler(w, req)
54-
}, &testOptions{workerScript: "die.php", nbWorkers: 1, nbParrallelRequests: 10})
54+
}, &testOptions{workerScript: "die.php", nbWorkers: 1, nbParallelRequests: 10})
5555
}
5656

5757
func TestNonWorkerModeAlwaysWorks(t *testing.T) {
@@ -90,7 +90,7 @@ func TestWorkerEnv(t *testing.T) {
9090
body, _ := io.ReadAll(resp.Body)
9191

9292
assert.Equal(t, fmt.Sprintf("bar%d", i), string(body))
93-
}, &testOptions{workerScript: "worker-env.php", nbWorkers: 1, env: map[string]string{"FOO": "bar"}, nbParrallelRequests: 10})
93+
}, &testOptions{workerScript: "worker-env.php", nbWorkers: 1, env: map[string]string{"FOO": "bar"}, nbParallelRequests: 10})
9494
}
9595

9696
func TestWorkerGetOpt(t *testing.T) {
@@ -150,5 +150,5 @@ func TestWorkerHasOSEnvironmentVariableInSERVER(t *testing.T) {
150150

151151
assert.Contains(t, string(body), "CUSTOM_OS_ENV_VARIABLE")
152152
assert.Contains(t, string(body), "custom_env_variable_value")
153-
}, &testOptions{workerScript: "worker.php", nbWorkers: 1, nbParrallelRequests: 1})
153+
}, &testOptions{workerScript: "worker.php", nbWorkers: 1, nbParallelRequests: 1})
154154
}

0 commit comments

Comments
 (0)