Skip to content

Commit a35ec28

Browse files
Test should cover not stripping the path as well
1 parent dd1adc7 commit a35ec28

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internal/server/router_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,14 @@ func TestRouter_PathBasedRoutingStripPrefix(t *testing.T) {
322322
statusCode, body = sendGETRequest(router, "http://example.com/appointment")
323323
assert.Equal(t, http.StatusOK, statusCode)
324324
assert.Equal(t, "/appointment", body)
325+
326+
serviceOptions.StripPrefix = false
327+
328+
require.NoError(t, router.SetServiceTarget("service2", []string{"example.com"}, []string{"/app"}, backend, serviceOptions, defaultTargetOptions, DefaultDeployTimeout, DefaultDrainTimeout))
329+
330+
statusCode, body = sendGETRequest(router, "http://example.com/app")
331+
assert.Equal(t, http.StatusOK, statusCode)
332+
assert.Equal(t, "/app", body)
325333
}
326334

327335
func TestRouter_PathBasedRoutingWithHosts(t *testing.T) {

0 commit comments

Comments
 (0)