Skip to content

Commit

Permalink
fix logic issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bubbajoe committed May 20, 2024
1 parent b231146 commit a156517
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 50 deletions.
2 changes: 1 addition & 1 deletion functional-tests/admin_tests/modify_response_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ dgate-cli route create \
namespace=test-ns \
service='base_svc'

curl ${PROXY_URL}/test -H Host:test.com
curl -s ${PROXY_URL}/test -H Host:test.com

echo "Modify Response Test Passed"
5 changes: 1 addition & 4 deletions internal/proxy/module_extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,7 @@ func (me *moduleExtract) RequestHandlerFunc() (extractors.RequestHandlerFunc, bo
}

func NewDefaultModuleExtractor() ModuleExtractor {

Check warning on line 103 in internal/proxy/module_extractor.go

View check run for this annotation

Codecov / codecov/patch

internal/proxy/module_extractor.go#L103

Added line #L103 was not covered by tests
return &moduleExtract{
fetchUpstreamUrl: extractors.DefaultFetchUpstreamFunction(),
errorHandler: extractors.DefaultErrorHandlerFunction(),
}
return &moduleExtract{}
}

type ModuleExtractorFunc func(*RequestContextProvider) (ModuleExtractor, error)
12 changes: 6 additions & 6 deletions pkg/modules/types/module_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ func (modCtx *ModuleContext) Params() map[string]string {
return modCtx.params
}

func (modCtx *ModuleContext) Route() spec.Route {
return *modCtx.route
func (modCtx *ModuleContext) Route() *spec.Route {
return modCtx.route

Check warning on line 65 in pkg/modules/types/module_context.go

View check run for this annotation

Codecov / codecov/patch

pkg/modules/types/module_context.go#L64-L65

Added lines #L64 - L65 were not covered by tests
}

func (modCtx *ModuleContext) Service() spec.Service {
return *modCtx.svc
func (modCtx *ModuleContext) Service() *spec.Service {
return modCtx.svc
}

func (modCtx *ModuleContext) Namespace() spec.Namespace {
return *modCtx.ns
func (modCtx *ModuleContext) Namespace() *spec.Namespace {
return modCtx.ns

Check warning on line 73 in pkg/modules/types/module_context.go

View check run for this annotation

Codecov / codecov/patch

pkg/modules/types/module_context.go#L72-L73

Added lines #L72 - L73 were not covered by tests
}

func (modCtx *ModuleContext) Request() *RequestWrapper {
Expand Down
38 changes: 0 additions & 38 deletions pkg/modules/types/wrapper_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/scheduler/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func TestScheduleTask_Overwrite(t *testing.T) {
assert.True(t, test2Flag.Load())
}

func TestScheduleTask_TimeoutIntervalFail(t *testing.T) {
func TestScheduleTask_TimeoutIntervalError(t *testing.T) {
sch := scheduler.New(scheduler.Options{
Interval: time.Millisecond * 10,
AutoRun: true,
Expand Down

0 comments on commit a156517

Please sign in to comment.