projectkudu / kudu

Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites. It can also run outside of Azure.
Apache License 2.0
3.12k stars 654 forks source link

Kudu file viewer trims white space #2574

Closed UsmanMohammad closed 6 years ago

UsmanMohammad commented 6 years ago

For deployment issues, please provide us with the following information:

Repro steps.

Create a file with space at the front of the file name Create a file with the same name but with no space Files will look identical, only way to discern difference is to use ls on the console.

Mention any other details that might be useful.

Ran into this as our applicationHost.xdt file had a space infront of its file name. Kudu's ui didn't show a space. I only realised the file had a space at the front because I created a file with the exact same name (with out the space at the front) and saw that both files existed. I then used ls in the prompt and saw that one of the files had a space.


Thanks! We'll be in touch soon.

watashiSHUN commented 6 years ago

it looks to be a html css thing, I can get the result by adding a css property whites-pace: pre Although having spaces in file name is usually not considered a good practice, but since it is allowed, I guess we can make the change? image

davidebbo commented 6 years ago

Using spaces is one thing, but using spaces at the beginning of the file name is another. The Windows shell doesn't even let you do that, as it auto-trims any heading/trailing spaces (even though NTFS does support it).

I don't think this is worth spending time on.

UsmanMohammad commented 6 years ago

Just want to clarify what happened ton us, It wasn't intentional, the file was created with the "+" button on the gui, and I had pasted the file name which also copied the space in front of the name.

This caused issues with our applicationHost.xdt file in the site folder.

Our webconfig was using a server variable, however our site crashed when ever it was calling that variable as we didn't have "applicationHost.xdt", instead we had " applicationHost.xdt" and couldn't figure out the problem from the web ui,.

Ideally, the "+" button from the ui should remove prepended spaces when naming the file.

davidebbo commented 6 years ago

Ah yes, then the real issue is that the + UI should trim the white spaces around the file name, and not that the whitespace is not displayed. I would definitely be up for fixing that part, which presumably is a missing trim() call somewhere in the UI logic.

xt0rted commented 6 years ago

I've run into the same issue in the azure portal when setting up app settings. So much wasted time 😞