You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fails for an existing and working URL without error message
Credentials are set correctly.
Other GET requests work fine.
GeoServer version 2.21.0.
geoserver-node-client version 1.1.0
Running an minimal example shows the same problem.
importfetchfrom'node-fetch';(async()=>{consturl='http://localhost:8080/geoserver/rest/workspaces/klips/coveragestores/foo/coverages/jm-mosaic/index/granules.json';constresponse=awaitfetch(url,{credentials: 'include',method: 'GET',headers: {'Authorization': 'Basic ????'}});console.log('Before JSON');constresult=awaitresponse.json();// <-- THE PROGRAM STOPS HERE WITHOUT ERROR messageconsole.log('After JSON');console.log(result);})();
Interestingly when node-fetch v3 is used. The program still fails but throws this error message:
file:///..../geoserver-node-client/node_modules/node-fetch/src/body.js:234
const error_ = error instanceof FetchBaseError ? error : new FetchError(`Invalid response body while trying to fetch ${data.url}: ${error.message}`, 'system', error);
^
FetchError: Invalid response body while trying to fetch http://localhost:8080/geoserver/rest/workspaces/klips/coveragestores/foo/coverages/jm-mosaic/index/granules.json: Premature close
at consumeBody (file:///.../geoserver-node-client/node_modules/node-fetch/src/body.js:234:60)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Response.text (file:///.../geoserver-node-client/node_modules/node-fetch/src/body.js:158:18)
at async Response.json (file://.../geoserver-node-client/node_modules/node-fetch/src/body.js:148:16)
at async file:///.../geoserver-node-client/demo/demo.js:16:20 {
type: 'system',
errno: 'ERR_STREAM_PREMATURE_CLOSE',
code: 'ERR_STREAM_PREMATURE_CLOSE',
erroredSysCall: undefined
geoserver-node-client
version 1.1.0Running an minimal example shows the same problem.
Interestingly when
node-fetch
v3 is used. The program still fails but throws this error message:Calling the same URL with
axios
works fine:Update 2022-07-05
It seems to be a problem of GeoServer
2.21.0
. I tested it with GeoServer2.20.5
, there the function runs like it should.The text was updated successfully, but these errors were encountered: