Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #1223

Merged
merged 3 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion guides/https.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The `cacertfile` option is not needed when using a self-signed certificate, or w
keyfile: "/etc/letsencrypt/live/example.net/privkey.pem"
```

It is possible to bundle the certificate files with the application, possibly for packaging into a release. In this case the files must be stored under the application's 'priv' directory. The `otp_app` option must be set to the name of the OTP application that contains the files, in order to correctly resolve the relative paths:
It is possible to bundle the certificate files with the application, possibly for packaging into a release. In this case the files must be stored under the application's 'priv' directory. The `otp_app` option must be set to the name of the OTP application that contains the files, in order to correctly resolve the relative paths:

```elixir
Plug.Cowboy.https MyApp.MyPlug, [],
Expand Down
4 changes: 2 additions & 2 deletions lib/plug/debugger.ex
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ defmodule Plug.Debugger do

## Custom Banners

You may pass an MFA (`{module, function, args}`) to be invoked when an
You may pass a MFA (`{module, function, args}`) to be invoked when an
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the correct here is "an MFA". We should use "an" before "MFA" because the pronunciation of the letter "M" starts with a vowel sound (em).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know that. I'll update it. Thanks!

error is rendered which provides a custom banner at the top of the
debugger page. The function receives the following arguments, with the
passed `args` concatenated at the end:
Expand Down Expand Up @@ -496,7 +496,7 @@ defmodule Plug.Debugger do

{:ok, other} ->
raise ArgumentError,
"expected :banner to be an MFA ({module, func, args}), got: #{inspect(other)}"
"expected :banner to be a MFA ({module, func, args}), got: #{inspect(other)}"

:error ->
nil
Expand Down
8 changes: 4 additions & 4 deletions lib/plug/rewrite_on.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ defmodule Plug.RewriteOn do

The supported values are:

* `:x_forwarded_for` - to override the remote ip based on on the "x-forwarded-for" header
* `:x_forwarded_host` - to override the host based on on the "x-forwarded-host" header
* `:x_forwarded_port` - to override the port based on on the "x-forwarded-port" header
* `:x_forwarded_proto` - to override the protocol based on on the "x-forwarded-proto" header
* `:x_forwarded_for` - to override the remote ip based on the "x-forwarded-for" header
* `:x_forwarded_host` - to override the host based on the "x-forwarded-host" header
* `:x_forwarded_port` - to override the port based on the "x-forwarded-port" header
* `:x_forwarded_proto` - to override the protocol based on the "x-forwarded-proto" header

A tuple representing a Module-Function-Args can also be given as argument
instead of a list.
Expand Down
4 changes: 2 additions & 2 deletions lib/plug/session/cookie.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ defmodule Plug.Session.COOKIE do

* `:encryption_salt` - a salt used with `conn.secret_key_base` to generate
a key for encrypting/decrypting a cookie, can be either a binary or
an MFA returning a binary;
a MFA returning a binary;

* `:signing_salt` - a salt used with `conn.secret_key_base` to generate a
key for signing/verifying a cookie, can be either a binary or
an MFA returning a binary;
a MFA returning a binary;

* `:key_iterations` - option passed to `Plug.Crypto.KeyGenerator`
when generating the encryption and signing keys. Defaults to 1000;
Expand Down
5 changes: 3 additions & 2 deletions lib/plug/static.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule Plug.Static do
atom representing the application name (where assets will
be served from `priv/static`), a tuple containing the
application name and the directory to serve assets from (besides
`priv/static`), or an MFA tuple.
`priv/static`), or a MFA tuple.

The preferred form is to use `:from` with an atom or tuple, since
it will make your application independent from the starting directory.
Expand Down Expand Up @@ -167,7 +167,8 @@ defmodule Plug.Static do
%{
encodings: encodings,
only_rules: {Keyword.get(opts, :only, []), Keyword.get(opts, :only_matching, [])},
qs_cache: Keyword.get(opts, :cache_control_for_vsn_requests, "public, max-age=31536000, immutable"),
qs_cache:
Keyword.get(opts, :cache_control_for_vsn_requests, "public, max-age=31536000, immutable"),
et_cache: Keyword.get(opts, :cache_control_for_etags, "public"),
et_generation: Keyword.get(opts, :etag_generation, nil),
headers: Keyword.get(opts, :headers, %{}),
Expand Down