Abiola Ibrahim
23631cfaca
Fix deleted Content-Length header bug.
2015-12-08 12:01:24 +01:00
Abiola Ibrahim
8631f33940
remove minor ugly parenthesis
2015-12-07 23:27:57 +01:00
Abiola Ibrahim
ab5087e215
Gzip: support for min_length.
2015-12-07 23:17:05 +01:00
Matthew Holt
fd14f257df
markdown: Add (currently failing) test for empty body
2015-12-02 17:09:43 -07:00
Abiola Ibrahim
6f4835f91a
Markdown: Fix "metadata not closed" bug. More tests.
2015-12-03 00:41:12 +01:00
Matt Holt
ef2ca1da3d
Merge pull request #357 from tw4452852/my_md
...
markdown: fix json front matter parse issue when body content is long
2015-11-27 00:07:19 -07:00
Tw
fbc18c5b85
markdown: fix json format parse issue
...
We can't use json meta parser's remaining buffered data as the markdown body
because it may not contain the entire original content.
Now we adopt the way like toml and yaml parser's way to extract the meta content
at first.
Also when spilting the meta data and content body, additional io.Copy is
unnecessary.
Fix issue #355
Signed-off-by: Tw <tw19881113@gmail.com>
2015-11-25 08:32:14 +08:00
Abiola Ibrahim
016344bae7
Rewrite: Use middleware.Replacer for simple rule.
2015-11-24 12:20:39 +01:00
Luit van Drongelen
1fb66d534a
Close proxy's backend request earlier when re-connecting for websocket
2015-11-21 20:03:46 +01:00
Luit van Drongelen
f0b1edaf8c
Fix proxy for websocket with altered Host header
2015-11-21 20:00:44 +01:00
Matthew Holt
b9244cdf2e
templates: Another context fix when host header is missing port
2015-11-17 14:35:18 -07:00
Matthew Holt
1d47e590e5
proxy: Make headers when upstream is created; avoid potential nil ptr deref
2015-11-17 10:18:13 -07:00
Matt Holt
280ba9db85
Merge pull request #345 from tw4452852/my_proxy
...
proxy: make http header block scoped
2015-11-17 08:20:29 -07:00
Tw
a5b117fcdf
proxy: make tests workable when offline
...
Instead of accessing the google website, we setup a local server
for test, then tests will work fine even we are offline.
Fix issue #346
Signed-off-by: Tw <tw19881113@gmail.com>
2015-11-17 15:18:02 +08:00
Tw
f56d2090b6
proxy: make http header block scoped
...
Each proxy block should could specify its own http header
instead of sharing a global one.
Fix issue #341
Signed-off-by: Tw <tw19881113@gmail.com>
2015-11-17 14:07:32 +08:00
Abiola Ibrahim
7949388da8
Proxy: Allow ignored subpaths.
2015-11-16 17:22:06 +01:00
Matthew Holt
dd119e04b1
Fix go vet
2015-11-15 11:06:50 -07:00
Matthew Holt
f7cfe79905
websocket: Simple buildEnv test, and fix for addresses without port
2015-11-15 11:05:26 -07:00
Tatsuhiko Kubo
69662d4d7d
gzip: added Vary: Accept-Encoding to response header.
...
When the downstream is cache server or CDN, it is important.
2015-11-14 06:11:37 +09:00
Matthew Holt
76ec785e87
ext: Fix panic when URL path is empty
2015-11-10 16:04:02 -07:00
Matthew Holt
02213402e8
Unexport internal types; improved markdown summaries
2015-11-09 07:45:37 -07:00
Matthew Holt
171fd34b3c
markdown: Make base path optional, always generate links
...
The base path being optional in the Caddyfile is convenient when you just want the whole site to be markdown-enabled. The other change is to always generate links... this is because an index page for markdown files may not be statically generated, but it should still show links. Commit 09341fc
was a regression, and this fixes it.
2015-11-07 20:24:17 -07:00
Matt Holt
a1481bc29e
Merge pull request #306 from mholt/bug/websocket-races
...
fixed data races in websockets
2015-11-05 17:19:35 -07:00
Matthew Holt
bcea5182c6
Don't truncate process log; more consistent output
2015-11-05 17:01:08 -07:00
buddhamagnet
57f1d3c205
pass golint
...
pass all tests
respond to maintainer comments
reinstate assignment of t
correct typo
correct typo
pass linter some more
2015-11-05 00:40:35 +00:00
Austin
34c369155c
trim possible line terminators from message
2015-11-03 13:37:32 -08:00
Matthew Holt
ad057ab873
Merge branch 'master' into letsencrypt
...
Conflicts:
caddy/parse/parse.go
caddy/parse/parsing.go
config/config.go
config/setup/controller.go
main.go
server/server.go
2015-11-02 20:26:55 -07:00
Matthew Holt
09341fca12
markdown: Don't generate static site or links unless sitegen is enabled
2015-11-02 20:15:42 -07:00
Austin
abc7c6a148
fixed data races in websockets
2015-11-02 14:19:38 -08:00
Abiola Ibrahim
6a32076271
Merge pull request #299 from abiosoft/master
...
Fix for issues #297 and #298
2015-10-31 07:53:17 +01:00
Abiola Ibrahim
dd1c49bde9
Fix for issues #297 and #298
2015-10-31 02:24:37 +01:00
Guilherme Rezende
9d456bba9b
Add argument in new optional block in templates midd to set delimiters
2015-10-29 20:33:01 -02:00
Matthew Holt
d227bec0ff
Move common function into existing file
2015-10-29 10:34:47 -06:00
Matt Holt
a3f0fff734
Merge pull request #296 from Makpoc/last-modified
...
markdown, templates: Add Last-Modified header
2015-10-29 10:31:38 -06:00
Matthew Holt
234783548f
markdown: Enable tables, fenced code, and strikethrough ( closes #294 )
2015-10-29 09:59:32 -06:00
makpoc
5a29107f3b
Add Last-Modified header when serving markdown and templates
2015-10-29 11:06:35 +02:00
Matt Holt
94ff7dc6fb
Merge pull request #287 from Makpoc/parsewincmd
...
Fix windows command parsing
2015-10-27 23:50:21 -06:00
Matthew Holt
cc229aefae
templates: Parse host successfully when port is implicit ( fixes #292 )
2015-10-27 23:20:05 -06:00
Matthew Holt
4ebff9a130
core: Major refactor for graceful restarts; numerous fixes
...
Merged config and app packages into one called caddy. Abstracted away caddy startup functionality making it easier to embed Caddy in any Go application and use it as a library. Graceful restart (should) now ensure child starts properly. Now piping a gob bundle to child process so that the child can match up inherited listeners to server address. Much cleanup still to do.
2015-10-26 13:34:31 -06:00
Makpoc
d1b667fbce
Two quotes next to each other result in one escaped quote; Add Split Example, add/refactor tests for every platform.
2015-10-24 15:33:04 +03:00
makpoc
0d004ccbab
Attempt to fix windows command parsing + add more tests
2015-10-23 20:21:05 +03:00
Matthew Holt
fec491fb12
Removed another test that is Windows-specific
...
We're not trying to test the shlex library; just our wrapper function
2015-10-21 14:15:42 -06:00
Matthew Holt
794d271152
Remove extra tests that were Linux-specific
...
These tests with the backslash seem to assert that shlex (our Unix shell parsing library) is working properly, not our wrapper function (that parses commands for both Windows and non-Windows). These tests break on Windows so I have removed them.
2015-10-21 14:11:30 -06:00
Matthew Holt
29362e45bc
Parse Windows commands differently than Unix commands
...
Stinkin' backslashes
2015-10-21 14:03:33 -06:00
Makpoc
e3ec7394ab
fix go vet error
2015-10-21 02:18:33 +03:00
Makpoc
ddd69d19c0
Add tests for fileserver.go
2015-10-21 02:08:36 +03:00
Makpoc
8ecc366582
Check and return the correct error if Stat method fails (see golang issue #12991 )
2015-10-21 01:25:38 +03:00
makpoc
72a5579d83
Cover the rest of the (not one-liner) functions in context
2015-10-19 13:51:49 +03:00
Matt Holt
3faffdce2d
Merge pull request #274 from Makpoc/context_tests
...
Add context.go tests
2015-10-15 15:29:23 -06:00
Makpoc
d6242e9cac
Apply review comments - change the used domain, remove obsolete function, remove commented tests
2015-10-15 23:09:02 +03:00
makpoc
bd4d9c6fe2
add tests for context.Header,IP,URL,Host,Port,Method,PathMatches
2015-10-15 19:46:23 +03:00
makpoc
3440f5cfbe
add tests for context.Cookie() and context.IP()
2015-10-15 18:26:13 +03:00
Marcelo E. Magallon
d4a14af14d
Simplify websocket ticker shutdown code
...
"A receive from a closed channel returns the zero value immediately"
Close the tickerChan in the calling function, this causes "case <-c" to
unblock immediately, ending the goroutine and stopping the ticker.
2015-10-14 18:48:43 -06:00
Makpoc
f7e3ed13f9
TestInclude 2 should fail. Update test data and fix error checking
2015-10-15 02:21:02 +03:00
Makpoc
71c4962ff6
tests for context.Include
2015-10-15 02:09:37 +03:00
Matt Holt
65e812d3a9
Merge pull request #270 from Makpoc/master
...
Add tests for command splitting and fix root tests on Windows
2015-10-14 10:13:53 -06:00
Matt Holt
5c3085fe51
Merge pull request #271 from zmb3/windows_failures
...
Fix test failures on Windows.
2015-10-14 10:13:18 -06:00
Austin
24893bf740
removed panics, cleaned up leaking ticker routine
2015-10-13 19:07:54 -07:00
Zac Bergquist
16bd63fc26
Removed my debug prints
2015-10-13 20:04:34 -04:00
Zac Bergquist
e158cda057
Fix test failures on Windows.
...
Most of the Windows test failures are due to the path separator not being "/". The general approach I took here was to keep paths in "URL form" (ie using "/" separators) as much as possible, and only convert to native paths when we attempt to open a file. This will allow the most consistency between different host OS. For example, data structures that store paths still store them with "/" delimiters. Functions that accepted paths as input and return them as outputs still use "/".
There are still a few test failures that need to be sorted out.
- config/setup/TestRoot (I hear this has already been fixed by someone else)
- middleware/basicauth/TestBrowseTemplate and middleware/templates/Test (a line endings issue that I'm still working through)
2015-10-13 19:49:53 -04:00
makpoc
4544dabd56
Add tests for command splitting
2015-10-13 14:39:18 +03:00
Austin
222781abca
websocket refactored to use gorilla
2015-10-12 19:59:11 -07:00
Zac Bergquist
f9bc74626d
Address various lint and gocyclo warnings. Fixes #253
2015-10-11 16:28:02 -04:00
Matthew Holt
d414ef0d0f
browse: Fix tests that fail only in CI environment
...
... I think. Submitting as PR to double-check. This change changes file mod times on the testdata to ensure they are not all the same so that the sort is predictable!
2015-10-10 19:53:11 -06:00
Karthic Rao
f5cd4f17f8
Exhaustive test coverage to test the usage of sort,order and limit parameter for the browse middleware
2015-10-09 11:28:11 +05:30
Matthew Holt
e6ba930e65
Merge branch 'master' of github.com:mholt/caddy
2015-10-01 09:58:17 -07:00
Matthew Holt
61a6b9511a
Commenting on the need for additional redirect tests
2015-10-01 09:58:07 -07:00
Matt Holt
87efc67f48
Merge pull request #259 from abiosoft/master
...
New core middleware, MIME.
2015-10-01 09:56:56 -07:00
Abiola Ibrahim
9e2da6ec48
New core middleware, MIME.
2015-09-30 18:37:10 +01:00
Matthew Holt
3f9f675c43
redir: Include scheme in redirect rules
...
And added tests for status code and scheme
2015-09-30 08:38:31 -06:00
Matthew Holt
122e3a9430
rewrite: Make internal header field name a const
2015-09-28 14:54:48 -06:00
Mathias Beke
bb85a84561
Merge remote-tracking branch 'upstream/master'
...
Conflicts:
middleware/fastcgi/fastcgi.go
2015-09-28 22:11:05 +02:00
Matthew Holt
be6fc35326
fastcgi: Fix REQUEST_URI if rewrite directive changes URL
2015-09-27 18:48:28 -06:00
Mathias Beke
8baead6107
Merge remote-tracking branch 'upstream/master'
2015-09-25 11:54:15 +02:00
Matthew Holt
4f5a29d6d1
errors: New 'visible' mode to write stack trace to response
...
Also updated change list and added/improved tests
2015-09-24 16:21:28 -06:00
Matthew Holt
da7562367c
errors: Restore http status text in test
2015-09-24 14:01:08 -06:00
Matthew Holt
6001c94f30
errors: Fix test
2015-09-24 13:46:54 -06:00
Matt Holt
104a5998cb
Merge pull request #251 from abiosoft/master
...
rewrite: Use middleware.Replacer
2015-09-23 14:22:54 -06:00
Matthew Holt
6cbd3ab096
proxy: 64-bit word alignment for 32-bit systems ( fixes #252 )
2015-09-22 16:47:39 -06:00
Abiola Ibrahim
7f9fa5730b
Rewrite: Use only fragment
, remove frag
.
2015-09-20 18:13:53 +01:00
Matthew Holt
bdccc51437
More consistent error messages
2015-09-20 10:55:16 -06:00
Abiola Ibrahim
0e039a1868
Rewrite: Use middleware.Replacer.
...
Bug fix for regexps starting with '/'.
2015-09-20 08:49:55 +01:00
Matthew Holt
10ab037833
Moved fileServer and browse.IndexPages into middleware package
2015-09-19 20:35:48 -06:00
Henrique Dias
8120e57850
add user defined variables into browse template
2015-09-18 08:52:12 +01:00
Matt Holt
66fb8f031b
Merge pull request #248 from hacdias/master
...
browse: Option to ignore indexes
2015-09-17 19:01:12 -06:00
Matthew Holt
9e2bef146e
middleware: Added StripHTML to Context type
2015-09-17 16:23:30 -06:00
Henrique Dias
30b19190dc
add ignoreIndexes option to browse
2015-09-17 20:33:39 +01:00
Matthew Holt
8c843ceefd
middleware: Add StripExt to Context type for stripping extensions from paths
2015-09-16 21:31:58 -06:00
Mathias Beke
aa5a595762
middleware/fastcgi: Stripping PATH_INFO from SCRIPT_NAME
2015-09-16 20:25:40 +02:00
Alexander Morozov
faaef83954
Use less strict condition to avoid problems with concurrency
...
In latest go versions TestWatcher fails pretty often, because it is
"more concurrent" now. Reproducible with go master:
while go test github.com/mholt/caddy/middleware/markdown; do :; done
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-09-11 10:25:13 -07:00
Abiola Ibrahim
7545755b00
Merge pull request #240 from LK4D4/fix_map_race
...
markdown: fix race in accessing map
2015-09-11 17:00:24 +01:00
Alexander Morozov
a5128da67a
markdown: fix race in accessing map
...
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-09-11 08:34:52 -07:00
Alexander Morozov
37eedf5cdc
Fix race in test
...
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-09-11 08:34:08 -07:00
Alexander Morozov
da7b9a6bbc
Use markdown.Config as pointer everywhere
...
* As value mutex was copied and therefore synchronization worked wrong
* It's pretty big structure with reference types, so copying create unnecessary
pressure on GC
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-09-10 15:12:50 -07:00
Karthic Rao
ed4148f20e
Complete test coverage for replacer for Go
2015-09-10 10:28:13 +05:30
Matthew Holt
4e1717db4c
basicauth: htpasswd path now relative to site root
2015-09-05 16:04:30 -06:00
Matt Holt
159b68aab4
Merge pull request #228 from tgulacsi/htpasswd
...
basicauth: Add htpasswd support
2015-09-05 14:56:23 -06:00
Alexander Morozov
b199825c3b
Fix formatting directives in tests
...
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-09-04 08:34:58 -07:00
Maxime
bdcbd11d65
Merge branch 'master' of https://github.com/mholt/caddy
2015-09-02 15:16:06 +02:00
Maxime
008160998a
Added LogRoller parser and entity.
...
The errors and logs can now have log rolling if provided by the user.
The current customisable parameter of it are:
The maximal size of the file before rolling.
The maximal age/time of the file before rolling.
The number of backups to keep.
2015-09-02 15:13:31 +02:00
Tamás Gulácsi
392f1d70eb
Add htpasswd support for basic auth
...
If the password arg starts with htpasswd=, then the rest is treated as
the file name of the htpasswd file, and used for md5 and sha1 hashes.
2015-08-30 20:08:42 +02:00
karthic rao
e3cea042d6
Left over comments removed
...
Redundant comments in the code removed
2015-08-30 19:00:35 +05:30
Karthic Rao
679668e3c0
removed redundant comment lines
2015-08-30 18:57:20 +05:30
Karthic Rao
730269743f
Json response initial test for browse.go
2015-08-29 08:04:01 +05:30
Karthic Rao
444f9e40d5
initial test for replacer
2015-08-27 23:36:32 +05:30
pyed
b9d3e7721e
Fixing my comment
...
the old comment might throw the source-reader off, my bad.
2015-08-27 18:01:46 +03:00
Abdulelah Alfuntukh
414b47d653
adds json option for the browse middleware
2015-08-24 23:37:11 +03:00
Karthic Rao
4704625e3a
Complete test coverage for middleware/recorder.go
2015-08-14 09:59:22 +05:30
Karthic Rao
53c4797606
Initial setup of test for recorder.go of middleware package
2015-08-11 22:02:13 +05:30
Karthic Rao
bb072faeee
Initial test for middleware/middleware.go
2015-08-08 00:56:59 +05:30
Matthew Holt
b62de4c521
New template action NowDate to get the time.Time of Now()
2015-08-05 08:27:13 -06:00
Matthew Holt
2e8a74ecff
markdown: Prefix log messages, and slight refactor
...
Also change sha1 to md5 for the directory scans; slightly faster.
2015-08-05 08:15:52 -06:00
Matthew Holt
e94e90b046
Add new docker link, DO link, and enhanced comment
2015-08-05 07:37:51 -06:00
Matthew Holt
7173764d6d
markdown: Render lists as part of summary (upstream bug workaround)
...
See github.com/russross/blackfriday/issues/189
2015-08-05 07:37:51 -06:00
Abiola Ibrahim
3b910645e7
Markdown: generate static sites after links.
2015-08-05 09:55:04 +01:00
Abiola Ibrahim
b5d79bdccc
Markdown: Removed unused constant.
2015-08-05 01:01:57 +01:00
Abiola Ibrahim
2ab466599d
Markdown: Modify development mode to generate links on page requests.
2015-08-05 00:41:04 +01:00
Abiola Ibrahim
851026d3fa
Markdown: Watch for file changes. Removed sitegen dependency for links.
2015-08-04 23:35:09 +01:00
Matthew Holt
8d81ae88da
fastcgi: Add HTTPS env variable on HTTPS connections
2015-08-03 17:16:24 -06:00
Matthew Holt
36fa6e857b
markdown: Sitegen only occurs if directory exists
...
We do this by returning an error and stopping link generation (which scans the markdown path for files)
2015-08-01 16:09:10 -06:00
Matthew Holt
35e25be1a4
browse: Size displayed in IEC format
...
Powers of 2, or base 1024, rather than powers of 10 or base 1000. The powers of 2 are technically more accurate.
2015-07-29 19:15:38 -06:00
Matthew Holt
f7129b219e
Fix markdown tests that I broke
2015-07-29 17:47:33 -06:00
Matthew Holt
ff28bc8b0a
markdown: Change .Url -> .URL, increase summary length
...
Also, summary truncated at nearest space instead of middle of word, and code spans become part of summary.
2015-07-29 17:43:00 -06:00
Matthew Holt
0b01489f7d
templates: Date -> Now, add Replace and Truncate
2015-07-29 17:43:00 -06:00
Maxime
ec51e14451
Merge branch 'master' of https://github.com/mholt/caddy
2015-07-29 23:43:26 +02:00
Matt Holt
86e9749d6c
Merge pull request #204 from abiosoft/master
...
markdown: Add .Links action and flattened metadata structure
.Links available only for generated sites and variables no longer in a [variables] category in metadata (flat structure).
2015-07-29 11:12:02 -06:00
Abiola Ibrahim
aa89f30f2a
renamed sorter to byDate.
2015-07-29 18:06:53 +01:00
Maxime
da794a866e
Change date of the files in test to serve the static file and not generate a new one
2015-07-29 18:00:08 +02:00
Maxime
705cd16dee
Fixed path issue: was absolute path but should be relative path
2015-07-29 17:12:32 +02:00
Maxime
0168a627a4
Added test on markdown static files generation
2015-07-29 16:21:35 +02:00
Abiola Ibrahim
7b29568eb1
Code cleanups.
...
Fix more race conditions.
2015-07-29 12:21:34 +01:00
Matthew Holt
a585379bbb
proxy: Parse error if property is unknown
2015-07-28 13:50:40 -06:00
Abiola Ibrahim
e240cd5ba2
Metadata variables flattened.
...
Fix race condition on parsers.
Added page links generator.
2015-07-28 05:21:09 +01:00
Maxime
d1eb2ea9e2
Changed metadata variables type:
...
from map[string]interface{} to map[string]string
2015-07-26 18:32:34 +02:00
Matthew Holt
453d3eb567
markdown: Fix when md file has front matter but empty body
2015-07-25 15:47:33 -06:00
Matt Holt
bf47951f3a
Merge pull request #196 from evermax/master
...
markdown, browse: Integrated Context struct for templating
2015-07-25 15:15:51 -06:00
Maxime
604c8abb59
Remove debug line, add file name as default title
2015-07-25 22:39:13 +02:00
Maxime
ef4a4b0ab8
Removed attribute not needed.
2015-07-24 22:17:14 +02:00
Maxime
24bdb433c9
Changed .Var to .Doc in Markdown templates
...
Put the title into the .Doc variables as well.
Changed the test template file to use new names.
2015-07-24 22:14:05 +02:00
Matthew Holt
a578c43810
browse: Add txt files to list of default files
2015-07-24 10:27:19 -06:00
Matthew Holt
74b758034e
redir: Allows replacements; defaults to exact match redirects
...
This is a breaking change for those who expect catch-all redirects to preserve path; use {uri} variable explicitly now
2015-07-24 10:27:19 -06:00
Matthew Holt
04571ff393
NewReplacer takes third argument for empty value string
2015-07-24 10:27:19 -06:00
pyed
1589129ea1
Save sorting preferences as cookies
...
To be used across directories
2015-07-23 13:25:03 +03:00
Maxime
97dcc79a7f
Remove undesired committed debug logs
2015-07-23 11:53:15 +02:00
Maxime
bc2feece4b
Moved test files to testdata folder.
...
Changed the tests accordingly.
2015-07-23 09:35:46 +02:00
Maxime
2df30d186e
Added a test on markdown for the default template
2015-07-21 17:45:32 +02:00
Maxime
6451e10d3e
Add context to markdown template
...
Created a struct containing middleware.Context, Title, Markdown and the
variables from the user to use to render the template.
The title now can be accessed via {{.Title}}.
The variables can now be accessed via {{.Var.myVariableName}}.
2015-07-21 07:58:34 +02:00
Matthew Holt
00997db5ae
markdown: Fix large markdown files that got truncated
2015-07-18 12:57:16 -06:00
Maxime
2d5320c454
Added test for the browse directive
...
Created sample files for the test
2015-07-18 11:37:05 +02:00
Maxime
2fa6e278d2
Merge branch 'master' of https://github.com/mholt/caddy
2015-07-18 09:58:27 +02:00