-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail on no content-type? #203
Comments
First thoughts :
I think that most problems comes from solid-rest. (1) core methods > getters >head resolves with Content-Tyep text/turtle for folder To have more information on tests you can add --verbose : npm run test:file --verbose |
With 2.0.6, 29 tests fail on https? So none of those are solid-rest issues? |
No all are solid-rest issues.
|
Ah, ok. What does NSS do when it gets a PUT or POST without a content-type? |
no reason to go against spec. PUT and POST MUST have contentType I shall try to look in more detail to solid-rest |
Solid-Rest fails for any PUT or POST without a content-type, but that causes 4 of the 29 test-failures. When I don't fail on missing content-type, 25 tests pass. |
|
Hmm deleteFolder() returns an array so one can't say let response = await deleteFolder(url); console.log(response.status). Is that what you'd expect? |
I am unable to cause an error running createFolder() on public or private resources on solidcommunity.net with or without a pre-existing folder of the same name. const SolidFileClient = require('./');
const {SolidNodeClient} = require('solid-node-client');
let auth = new SolidNodeClient();
let fc = new SolidFileClient(auth);
const creds = require('./creds');
let folder = "https://jeff-zucker.solidcommunity.net/private/test-folder/";
let r; // response
async function main(){
// login
let session = await auth.login(creds);
if(!session.isLoggedIn){ console.log("Could not login!"); process.exit(); }
else console.log(`logged in as <${session.WebID}>`);
// if prexists, deleteFolder
if( await fc.itemExists(folder) ){
r = await fc.deleteFolder(folder);
console.log( "Deleting Folder : ",r.status );
}
// createFolder
if( await fc.itemExists(folder) ) console.log( "Folder Exists." )
else console.log("Folder does not exist.");
r = await fc.createFolder(folder);
console.log( "Creating Folder : ",r.status )
// createFolder again
if( await fc.itemExists(folder) ) console.log( "Folder Exists." )
else console.log("Folder does not exist.");
r = await fc.createFolder(folder);
console.log( "Creating Folder : ",r.status )
// deleteFolder
r = await fc.deleteFolder(folder);
console.log( "Deleting Folder : ",r[0].status );
}
main(); |
^^^ using 2.0.6 |
Also tried when creating with intermediate non-existant folders, still no error. |
The spec requires a content-type for PUT and POST. Solid-Rest currently fails if it is missing. This causes 4 tests on Solid-File-Client to fail. I suggest that we make failure of PUT and POST without content-type an error in Solid-File-Client. If, instead, we want to guess the content-type from the extension, we should trap the error in Solid-File-Client rather than making rest go against the spec. @bourgeoa - thoughts?
The text was updated successfully, but these errors were encountered: