File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
packages/miniflare/test/plugins/core/proxy Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,28 @@ describe("ProxyClient", () => {
5757 expect ( event . data ) . toBe ( "echo:hello" ) ;
5858 } ) ;
5959
60+ test ( "preserves original URL for service binding fetch" , async ( {
61+ expect,
62+ } ) => {
63+ const mf = new Miniflare ( {
64+ script : nullScript ,
65+ serviceBindings : {
66+ CUSTOM ( request : Request ) {
67+ return new Response ( request . url ) ;
68+ } ,
69+ } ,
70+ } ) ;
71+ useDispose ( mf ) ;
72+
73+ const { CUSTOM } = await mf . getBindings < {
74+ CUSTOM : ReplaceWorkersTypes < Fetcher > ;
75+ } > ( ) ;
76+
77+ const url = "https://placeholder/path?query=value" ;
78+ const res = await CUSTOM . fetch ( url ) ;
79+ expect ( await res . text ( ) ) . toBe ( url ) ;
80+ } ) ;
81+
6082 test ( "supports serialising multiple ReadableStreams, Blobs and Files" , async ( {
6183 expect,
6284 } ) => {
You can’t perform that action at this time.
0 commit comments