Skip to content

Commit a4d8ba9

Browse files
committed
godoc update
1 parent 995fd2f commit a4d8ba9

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

ahttp.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) Jeevanandam M (https://github.com/jeevatkm)
2-
// go-aah/ahttp source code and usage is governed by a MIT style
2+
// aahframework.org/ahttp source code and usage is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

55
// Package ahttp is to cater HTTP helper methods for aah framework.
@@ -128,7 +128,7 @@ func Scheme(r *http.Request) string {
128128
return "http"
129129
}
130130

131-
// Host method is to correct Hosyt source value from HTTP request.
131+
// Host method is to correct Host value from HTTP request.
132132
func Host(r *http.Request) string {
133133
if r.URL.Host == "" {
134134
return r.Host
@@ -137,7 +137,8 @@ func Host(r *http.Request) string {
137137
}
138138

139139
// ClientIP method returns remote Client IP address aka Remote IP.
140-
// It parses in the order of given set of headers otherwise it uses default
140+
//
141+
// It parses in the order of given headers otherwise it uses default
141142
// default header set `X-Forwarded-For`, `X-Real-IP`, "X-Appengine-Remote-Addr"
142143
// and finally `http.Request.RemoteAddr`.
143144
func ClientIP(r *http.Request, hdrs ...string) string {

request.go

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) Jeevanandam M (https://github.com/jeevatkm)
2-
// go-aah/ahttp source code and usage is governed by a MIT style
2+
// aahframework.org/ahttp source code and usage is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

55
package ahttp
@@ -61,13 +61,13 @@ type Request struct {
6161
// Proto value is current HTTP request protocol. (e.g. HTTP/1.1, HTTP/2.0)
6262
Proto string
6363

64-
// Method request method e.g. `GET`, `POST`, etc.
64+
// Method value is HTTP verb from request e.g. `GET`, `POST`, etc.
6565
Method string
6666

67-
// Path the request URL Path e.g. `/app/login.html`.
67+
// Path value is request relative URL Path e.g. `/app/login.html`.
6868
Path string
6969

70-
// Header request HTTP headers
70+
// Header is request HTTP headers
7171
Header http.Header
7272

7373
// PathParams value is URL path parameters.
@@ -132,12 +132,8 @@ func (r *Request) SetAcceptEncoding(encoding *AcceptSpec) *Request {
132132
}
133133

134134
// ClientIP method returns remote client IP address aka Remote IP.
135-
// It parses in the order of `X-Forwarded-For`, `X-Real-IP` and
136-
// finally `http.Request.RemoteAddr`.
137135
//
138-
// Note: Make these header configurable from aah.conf so that aah user
139-
// could configure headers of their choice. For e.g.
140-
// X-Appengine-Remote-Addr, etc.
136+
// Refer to method `ahttp.ClientIP`.
141137
func (r *Request) ClientIP() string {
142138
return ClientIP(r.Unwrap())
143139
}

0 commit comments

Comments
 (0)