Open Prashant2603 opened 11 months ago
@ludup @brett-smith @dandalf Could someone help me here? Everywhere in code I see // Remove trailing forward slash if (absolutePath.endsWith("/")) { absolutePath = absolutePath.substring(0, absolutePath.length() - 1); }
How many servers are affected by this? This is a long-standing behaviour I've not had reports about before, and this code goes back to previous generations. The furthest I can go back to is the initial commit of Maverick Legacy to private git in 2015, which still appears to do this. If I'd had a problem supporting commercial customers since that commit, there would already be a switch there.
You could propose a change to implement a configuration switch. Look at AdaptiveConfiguration, While it's not used much at the moment in Synergy, the plan is to move all configurations over to using it to match the legacy API flexibility.
With the 3.1.2-SNAPSHOT, you can -Dmaverick.disableSlashRemoval=true to remove the path processing.
As stated before, this code has existed for a long time and in all the years I've supported the various APIs it has not come up as a problem before. Its inclusion would suggest my former self had good reason for doing it.
You can now disable it system-wide with this system property switch. Please let us know if you encounter any problems with this switch enabled.
In a future release (3.2), it will be possible to configure this per connection through the planned extension of the Adaptive configuration file. However, if you need this before you could always modify the SftpClient to have a boolean option set on individual instances.
For one of our use case where we are trying to connect to a sftp server we can see some weird behavior. In this particular case SFTP server allows cd command only with a '/' at end