Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ jobs:
working-directory: internal/testcli/
run: go build
- name: Compile library tests
run: go test -race -v -x -c
run: go test -race -failfast -v -x -c
Comment thread
henderkes marked this conversation as resolved.
Outdated
- name: Run library tests
run: ./frankenphp.test -test.v
run: ./frankenphp.test -test.v -test.failfast
- name: Run Caddy module tests
working-directory: caddy/
run: go test -race -v ./...
run: go test -race -failfast -v ./...
- name: Run Fuzzing Tests
working-directory: caddy/
run: go test -fuzz FuzzRequest -fuzztime 20s
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
- name: Build
run: go build -tags nowatcher
- name: Run library tests
run: go test -tags nowatcher -race -v ./...
run: go test -tags nowatcher -race -failfast -v ./...
- name: Run Caddy module tests
working-directory: caddy/
run: go test -race -v ./...
run: go test -race -failfast -v ./...
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/caddy/frankenphp/Build
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to revert?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added these because I often times find myself verifying bug reports there

I'm thinking they're fine in the .gitignore, but if you want I can revert

/caddy/frankenphp/Caddyfile.test
/caddy/frankenphp/frankenphp
/caddy/frankenphp/frankenphp.exe
/caddy/frankenphp/public
/dist
/github_conf
/internal/testserver/testserver
Expand Down
6 changes: 2 additions & 4 deletions cgi.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ func addKnownVariablesToServer(fc *frankenPHPContext, trackVarsArray *C.zval) {
requestURI = fc.requestURI
}

requestPath := ensureLeadingSlash(request.URL.Path)

C.frankenphp_register_server_vars(trackVarsArray, C.frankenphp_server_vars{
// approximate total length to avoid array re-hashing:
// 28 CGI vars + headers + environment
Expand All @@ -129,8 +127,8 @@ func addKnownVariablesToServer(fc *frankenPHPContext, trackVarsArray *C.zval) {
document_root_len: C.size_t(len(fc.documentRoot)),
path_info: toUnsafeChar(fc.pathInfo),
path_info_len: C.size_t(len(fc.pathInfo)),
php_self: toUnsafeChar(requestPath),
php_self_len: C.size_t(len(requestPath)),
php_self: toUnsafeChar(fc.scriptName),
php_self_len: C.size_t(len(fc.scriptName)),
document_uri: toUnsafeChar(fc.docURI),
document_uri_len: C.size_t(len(fc.docURI)),
script_filename: toUnsafeChar(fc.scriptFilename),
Expand Down
1 change: 1 addition & 0 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func NewRequestWithContext(r *http.Request, opts ...RequestOption) (*http.Reques
// If a worker is already assigned explicitly, use its filename and skip parsing path variables
if fc.worker != nil {
fc.scriptFilename = fc.worker.fileName
fc.scriptName = strings.TrimPrefix(fc.worker.fileName, fc.documentRoot)
} else {
// If no worker was assigned, split the path into the "traditional" CGI path variables.
// This needs to already happen here in case a worker script still matches the path.
Expand Down
Loading