Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
26f52a99
Commit
26f52a99
authored
Aug 21, 2016
by
Miek Gieben
Committed by
GitHub
Aug 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove old stuff from caddy and some go vet changes (#227)
parent
0be3fb49
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
62 deletions
+2
-62
middleware/etcd/lookup.go
middleware/etcd/lookup.go
+2
-2
middleware/middleware.go
middleware/middleware.go
+0
-60
No files found.
middleware/etcd/lookup.go
View file @
26f52a99
...
@@ -393,13 +393,13 @@ func (e Etcd) SOA(zone string, state middleware.State, opt Options) ([]dns.RR, [
...
@@ -393,13 +393,13 @@ func (e Etcd) SOA(zone string, state middleware.State, opt Options) ([]dns.RR, [
header
:=
dns
.
RR_Header
{
Name
:
zone
,
Rrtype
:
dns
.
TypeSOA
,
Ttl
:
300
,
Class
:
dns
.
ClassINET
}
header
:=
dns
.
RR_Header
{
Name
:
zone
,
Rrtype
:
dns
.
TypeSOA
,
Ttl
:
300
,
Class
:
dns
.
ClassINET
}
soa
:=
&
dns
.
SOA
{
Hdr
:
header
,
soa
:=
&
dns
.
SOA
{
Hdr
:
header
,
Mbox
:
"hostmaster
."
+
zone
,
Mbox
:
hostmaster
+
"
."
+
zone
,
Ns
:
"ns.dns."
+
zone
,
Ns
:
"ns.dns."
+
zone
,
Serial
:
uint32
(
time
.
Now
()
.
Unix
()),
Serial
:
uint32
(
time
.
Now
()
.
Unix
()),
Refresh
:
7200
,
Refresh
:
7200
,
Retry
:
1800
,
Retry
:
1800
,
Expire
:
86400
,
Expire
:
86400
,
Minttl
:
60
,
Minttl
:
minTTL
,
}
}
// TODO(miek): fake some msg.Service here when returning.
// TODO(miek): fake some msg.Service here when returning.
return
[]
dns
.
RR
{
soa
},
nil
,
nil
return
[]
dns
.
RR
{
soa
},
nil
,
nil
...
...
middleware/middleware.go
View file @
26f52a99
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
package
middleware
package
middleware
import
(
import
(
"time"
"github.com/miekg/dns"
"github.com/miekg/dns"
"golang.org/x/net/context"
"golang.org/x/net/context"
)
)
...
@@ -55,61 +53,3 @@ func (f HandlerFunc) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.
...
@@ -55,61 +53,3 @@ func (f HandlerFunc) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.
}
}
const
Namespace
=
"coredns"
const
Namespace
=
"coredns"
// IndexFile looks for a file in /root/fpath/indexFile for each string
// in indexFiles. If an index file is found, it returns the root-relative
// path to the file and true. If no index file is found, empty string
// and false is returned. fpath must end in a forward slash '/'
// otherwise no index files will be tried (directory paths must end
// in a forward slash according to HTTP).
//
// All paths passed into and returned from this function use '/' as the
// path separator, just like URLs. IndexFle handles path manipulation
// internally for systems that use different path separators.
/*
func IndexFile(root http.FileSystem, fpath string, indexFiles []string) (string, bool) {
if fpath[len(fpath)-1] != '/' || root == nil {
return "", false
}
for _, indexFile := range indexFiles {
// func (http.FileSystem).Open wants all paths separated by "/",
// regardless of operating system convention, so use
// path.Join instead of filepath.Join
fp := path.Join(fpath, indexFile)
f, err := root.Open(fp)
if err == nil {
f.Close()
return fp, true
}
}
return "", false
}
// SetLastModifiedHeader checks if the provided modTime is valid and if it is sets it
// as a Last-Modified header to the ResponseWriter. If the modTime is in the future
// the current time is used instead.
func SetLastModifiedHeader(w http.ResponseWriter, modTime time.Time) {
if modTime.IsZero() || modTime.Equal(time.Unix(0, 0)) {
// the time does not appear to be valid. Don't put it in the response
return
}
// RFC 2616 - Section 14.29 - Last-Modified:
// An origin server MUST NOT send a Last-Modified date which is later than the
// server's time of message origination. In such cases, where the resource's last
// modification would indicate some time in the future, the server MUST replace
// that date with the message origination date.
now := currentTime()
if modTime.After(now) {
modTime = now
}
w.Header().Set("Last-Modified", modTime.UTC().Format(http.TimeFormat))
}
*/
// currentTime, as it is defined here, returns time.Now().
// It's defined as a variable for mocking time in tests.
var
currentTime
=
func
()
time
.
Time
{
return
time
.
Now
()
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment