From abc895c6c8ce7ad4678ff4e2b8833801ae3e61d8 Mon Sep 17 00:00:00 2001 From: "Kian-Meng, Ang" Date: Sun, 29 Aug 2021 22:32:15 +0800 Subject: [PATCH] Fix typos --- doc/src/guide/migrating_from_2.5.asciidoc | 2 +- doc/src/manual/cowboy_stream.asciidoc | 6 +++--- doc/src/manual/cowboy_websocket.asciidoc | 2 +- doc/src/specs/rfc7230_server.ezdoc | 2 +- erlang.mk | 2 +- examples/markdown_middleware/src/erlmarkdown.erl | 8 ++++---- src/cowboy_http.erl | 8 ++++---- src/cowboy_rest.erl | 2 +- test/handlers/stop_handler_h.erl | 2 +- test/handlers/switch_handler_h.erl | 2 +- test/rest_handler_SUITE.erl | 2 +- test/rfc7230_SUITE.erl | 2 +- test/rfc8441_SUITE.erl | 4 ++-- 13 files changed, 22 insertions(+), 22 deletions(-) diff --git a/doc/src/guide/migrating_from_2.5.asciidoc b/doc/src/guide/migrating_from_2.5.asciidoc index b91b617f..5196cc7e 100644 --- a/doc/src/guide/migrating_from_2.5.asciidoc +++ b/doc/src/guide/migrating_from_2.5.asciidoc @@ -64,7 +64,7 @@ experimental. * Add automatic handling of range requests to REST handlers that return the callback `auto` from `ranges_accepted/2`. Cowboy will call the configured `ProvideCallback` and - then split the ouput automatically for the ranged response. + then split the output automatically for the ranged response. * Enable range requests support in `cowboy_static`. diff --git a/doc/src/manual/cowboy_stream.asciidoc b/doc/src/manual/cowboy_stream.asciidoc index 65bd06ec..148c23ee 100644 --- a/doc/src/manual/cowboy_stream.asciidoc +++ b/doc/src/manual/cowboy_stream.asciidoc @@ -52,11 +52,11 @@ HTTP/1.1 will initialize a stream only when the request-line and all headers have been received. When errors occur before that point Cowboy will call the callback `early_error/5` with a partial request, the error reason and the response -Cowboy intends to send. All other events go throuh the +Cowboy intends to send. All other events go through the stream handler using the normal callbacks. HTTP/2 will initialize the stream when the `HEADERS` block has -been fully received and decoded. Any protocol error occuring +been fully received and decoded. Any protocol error occurring before that will not result in a response being sent and will therefore not go through the stream handler. In addition Cowboy may terminate streams without sending an HTTP response @@ -278,7 +278,7 @@ This can also be used to override stream handler options. For example this is supported by link:man:cowboy_compress_h(3)[cowboy_compress_h(3)]. -Not all options can be overriden. Please consult the +Not all options can be overridden. Please consult the relevant option's documentation for details. == Predefined events diff --git a/doc/src/manual/cowboy_websocket.asciidoc b/doc/src/manual/cowboy_websocket.asciidoc index 5b1558ce..df745076 100644 --- a/doc/src/manual/cowboy_websocket.asciidoc +++ b/doc/src/manual/cowboy_websocket.asciidoc @@ -126,7 +126,7 @@ timeout:: received first. {error, Reason}:: - A socket error ocurred. + A socket error occurred. == Types diff --git a/doc/src/specs/rfc7230_server.ezdoc b/doc/src/specs/rfc7230_server.ezdoc index 2497f565..038aa6e8 100644 --- a/doc/src/specs/rfc7230_server.ezdoc +++ b/doc/src/specs/rfc7230_server.ezdoc @@ -59,7 +59,7 @@ features understood or safely ignored by HTTP/1.0 clients. (RFC7230 A) It is recommended to limit the request-line length to a configurable limit of at least 8000 octets. However, as the possible line length is -highly dependent on what form the request-target takes, it is preferrable +highly dependent on what form the request-target takes, it is preferable to limit each individual components of the request-target. (RFC7230 3.1.1) A request line too long must be rejected with a 414 status code diff --git a/erlang.mk b/erlang.mk index f152c374..8380fb94 100644 --- a/erlang.mk +++ b/erlang.mk @@ -627,7 +627,7 @@ pkg_check_node_commit = master PACKAGES += chronos pkg_chronos_name = chronos -pkg_chronos_description = Timer module for Erlang that makes it easy to abstact time out of the tests. +pkg_chronos_description = Timer module for Erlang that makes it easy to abstract time out of the tests. pkg_chronos_homepage = https://github.com/lehoff/chronos pkg_chronos_fetch = git pkg_chronos_repo = https://github.com/lehoff/chronos diff --git a/examples/markdown_middleware/src/erlmarkdown.erl b/examples/markdown_middleware/src/erlmarkdown.erl index 6cab50d7..4acfac0a 100644 --- a/examples/markdown_middleware/src/erlmarkdown.erl +++ b/examples/markdown_middleware/src/erlmarkdown.erl @@ -317,7 +317,7 @@ parse_list(Type, [{{Type, P}, _} | T], R, I, A, Wrap) -> NewWrap2 = case T of [] -> - false; % doesnt matter + false; % doesn't matter [H2 | _T2] -> case H2 of {linefeed, _} -> @@ -333,7 +333,7 @@ parse_list(_Type, List, _R, _I, A, _) -> {List, lists:reverse(A)}. %% grab grabs normals, double codeblocks, linefeeds and blanks -%% BUT stop grabbing if a normal if preceeded by a linefeed or blank +%% BUT stop grabbing if a normal if preceded by a linefeed or blank %% UNLESS the normal starts with white space :( %% the third return parameter is 'true' if the 'li' should be %% wrapped in '

' and false if it shouldn't @@ -768,8 +768,8 @@ type_ol1(_List, _Acc) -> %% '### blah' is fine %% '### blah ###' is reduced to '### blah' because trailing #'s are %% just for show but... -%% '##' is like appling '#' to '#' <-- applying 1 less styling to a single # -%% and '###' is like appling '##' to '#' etc, etc +%% '##' is like applying '#' to '#' <-- applying 1 less styling to a single # +%% and '###' is like applying '##' to '#' etc, etc %% but after you hit 6#'s you just get this for a single hash %% ie '#############' is like applying '######' to a single '#' %% but/and '######## blah' is like apply '######' to '## blah' diff --git a/src/cowboy_http.erl b/src/cowboy_http.erl index c9bceed8..51da27e3 100644 --- a/src/cowboy_http.erl +++ b/src/cowboy_http.erl @@ -108,7 +108,7 @@ opts = #{} :: cowboy:opts(), buffer = <<>> :: binary(), - %% Some options may be overriden for the current stream. + %% Some options may be overridden for the current stream. overriden_opts = #{} :: cowboy:opts(), %% Remote address and port for the connection. @@ -289,7 +289,7 @@ set_timeout(State0=#state{opts=Opts, overriden_opts=Override}, Name) -> idle_timeout -> 60000 end, Timeout = case Override of - %% The timeout may have been overriden for the current stream. + %% The timeout may have been overridden for the current stream. #{Name := Timeout0} -> Timeout0; _ -> maps:get(Name, Opts, Default) end, @@ -984,7 +984,7 @@ commands(State0=#state{flow=Flow0}, StreamID, [{flow, Size}|Tail]) -> Flow0 < 0 -> Size; true -> Flow0 + Size end, - %% Reenable active mode if necessary. + %% Re-enable active mode if necessary. State = if Flow0 =< 0, Flow > 0 -> active(State0); @@ -1288,7 +1288,7 @@ stream_terminate(State0=#state{opts=Opts, in_streamid=InStreamID, in_state=InSta _ -> %% done or Version =:= 'HTTP/1.0' State0 end, - %% Stop the stream, shutdown children and reset overriden options. + %% Stop the stream, shutdown children and reset overridden options. {value, #stream{state=StreamState}, Streams} = lists:keytake(StreamID, #stream.id, Streams1), stream_call_terminate(StreamID, Reason, StreamState, State1), diff --git a/src/cowboy_rest.erl b/src/cowboy_rest.erl index 7d0fe80a..4754f239 100644 --- a/src/cowboy_rest.erl +++ b/src/cowboy_rest.erl @@ -554,7 +554,7 @@ match_media_type_params(Req, State, Accept, %% When we match against a wildcard, the media type is text %% and has a charset parameter, we call charsets_provided %% and check that the charset is provided. If the callback - %% is not exported, we accept inconditionally but ignore + %% is not exported, we accept unconditionally but ignore %% the given charset so as to not send a wrong value back. case call(Req, State, charsets_provided) of no_call -> diff --git a/test/handlers/stop_handler_h.erl b/test/handlers/stop_handler_h.erl index 423c3f93..fa9f937f 100644 --- a/test/handlers/stop_handler_h.erl +++ b/test/handlers/stop_handler_h.erl @@ -159,7 +159,7 @@ do_default(Req=#{qs := <<"moved_permanently">>}, State, previously_existed) -> {true, Req, State}; do_default(Req=#{qs := <<"moved_temporarily">>}, State, previously_existed) -> {true, Req, State}; -%% We need the DELETE to suceed to reach this callback. +%% We need the DELETE to succeed to reach this callback. do_default(Req=#{qs := <<"delete_completed">>}, State, delete_resource) -> {true, Req, State}; %% We should never reach these callbacks. diff --git a/test/handlers/switch_handler_h.erl b/test/handlers/switch_handler_h.erl index 79a84e45..73d46f0d 100644 --- a/test/handlers/switch_handler_h.erl +++ b/test/handlers/switch_handler_h.erl @@ -160,7 +160,7 @@ do_default(Req=#{qs := <<"moved_permanently">>}, State, previously_existed) -> {true, Req, State}; do_default(Req=#{qs := <<"moved_temporarily">>}, State, previously_existed) -> {true, Req, State}; -%% We need the DELETE to suceed to reach this callback. +%% We need the DELETE to succeed to reach this callback. do_default(Req=#{qs := <<"delete_completed">>}, State, delete_resource) -> {true, Req, State}; %% We should never reach these callbacks. diff --git a/test/rest_handler_SUITE.erl b/test/rest_handler_SUITE.erl index 1667565b..b0828102 100644 --- a/test/rest_handler_SUITE.erl +++ b/test/rest_handler_SUITE.erl @@ -127,7 +127,7 @@ do_accept_callback_true(Config, Fun) -> ok. charset_in_content_types_provided(Config) -> - doc("When a charset is matched explictly in content_types_provided, " + doc("When a charset is matched explicitly in content_types_provided, " "that charset is used and the charsets_provided callback is ignored."), ConnPid = gun_open(Config), Ref = gun:get(ConnPid, "/charset_in_content_types_provided", [ diff --git a/test/rfc7230_SUITE.erl b/test/rfc7230_SUITE.erl index 9846a0f8..d30f671c 100644 --- a/test/rfc7230_SUITE.erl +++ b/test/rfc7230_SUITE.erl @@ -289,7 +289,7 @@ must_understand_origin_form(Config) -> "Host: localhost\r\n" "\r\n"). -%% @todo Reenable this test once support for CONNECT is added. +%% @todo Re-enable this test once support for CONNECT is added. %origin_form_reject_if_connect(Config) -> % doc("origin-form is used when the client does not connect to a proxy, " % "does not use the CONNECT method and does not issue a site-wide " diff --git a/test/rfc8441_SUITE.erl b/test/rfc8441_SUITE.erl index 245658fa..6b403368 100644 --- a/test/rfc8441_SUITE.erl +++ b/test/rfc8441_SUITE.erl @@ -399,11 +399,11 @@ accept_handshake_when_enabled(Config) -> %% Closing a Websocket stream. -% The HTTP/2 stream closure is also analagous to the TCP connection closure of +% The HTTP/2 stream closure is also analogous to the TCP connection closure of % [RFC6455]. Orderly TCP level closures are represented as END_STREAM % ([RFC7540] Section 6.1) flags and RST exceptions are represented with % the RST_STREAM ([RFC7540] Section 6.4) frame with the CANCEL -% ([RFC7540] Secion 7) error code. +% ([RFC7540] Section 7) error code. %% @todo client close frame with END_STREAM %% @todo server close frame with END_STREAM