Skip to content

Commit 7d158e1

Browse files
committed
Remove more qualifiers
1 parent ebe3028 commit 7d158e1

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

CHANGELOG.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
- The `gleam/http` module gains the `Scheme`, `Service`, `Request`, and
66
`Response` types, along with associated functions `scheme_to_string`,
7-
`scheme_from_string`, `req_uri`, `response`, `req_segments`, `get_query`,
8-
`get_req_header`, `get_resp_header`, `prepend_req_header`, `seq_req_host`,
9-
`set_req_path`, `prepend_resp_header`, `set_method`, `set_req_body`,
10-
`set_resp_body`, `map_resp_body`, `map_req_body` `try_map_resp_body`,
11-
`set_query`, `req_from_uri`, `default_req`, and `redirect`.
7+
`scheme_from_string`, `req_uri`, `response`, `path_segments`, `get_query`,
8+
`get_req_header`, `get_resp_header`, `prepend_req_header`, `seq_host`,
9+
`set_path`, `prepend_resp_header`, `set_method`, `set_body`, `set_query`,
10+
`req_from_uri`, `default_req`, and `redirect`. `set_resp_body`,
11+
`map_resp_body`, `map_req_body` `try_map_resp_body`,
1212
- Created the `gleam/http/middleware` module with the `Middleware` type and
1313
the `method_override`, `prepend_resp_header`, `map_resp_body` middleware
1414
functions.

src/gleam/http.gleam

+3-3
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ pub fn response(status: Int) -> Response(Nil) {
185185

186186
/// Return the non-empty segments of a request path.
187187
///
188-
pub fn req_segments(request: Request(body)) -> List(String) {
188+
pub fn path_segments(request: Request(body)) -> List(String) {
189189
request.path
190190
|> uri.path_segments
191191
}
@@ -424,7 +424,7 @@ pub fn default_req() -> Request(String) {
424424
// TODO: record update syntax
425425
/// Set the method of the request.
426426
///
427-
pub fn set_req_host(req: Request(body), host: String) -> Request(body) {
427+
pub fn set_host(req: Request(body), host: String) -> Request(body) {
428428
let Request(
429429
method: method,
430430
headers: headers,
@@ -451,7 +451,7 @@ pub fn set_req_host(req: Request(body), host: String) -> Request(body) {
451451
// TODO: record update syntax
452452
/// Set the method of the request.
453453
///
454-
pub fn set_req_path(req: Request(body), path: String) -> Request(body) {
454+
pub fn set_path(req: Request(body), path: String) -> Request(body) {
455455
let Request(
456456
method: method,
457457
headers: headers,

test/gleam/http_test.gleam

+2-2
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ pub fn redirect_test() {
683683
should.equal(Ok("/other"), http.get_resp_header(response, "location"))
684684
}
685685

686-
pub fn req_segments_test() {
686+
pub fn path_segments_test() {
687687
let request = http.Request(
688688
method: http.Get,
689689
headers: [],
@@ -695,7 +695,7 @@ pub fn req_segments_test() {
695695
query: None,
696696
)
697697

698-
should.equal(["ellen", "ripley"], http.req_segments(request))
698+
should.equal(["ellen", "ripley"], http.path_segments(request))
699699
}
700700

701701
pub fn get_query_test() {

0 commit comments

Comments
 (0)