nodeSolidServer / nodeSolidServer/node-solid-server

POST does not work the way it did in 4.x

オープン
#1,246 コメント 10 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

good first issue test-case
主要言語
JavaScript
スター
1.8k
フォーク
308
PR マージ指標
30日以内にマージされた PR はありません

説明

From my testing (test attached below) I notice these differences:

POST "foo", no content-type                                                     
  4.x : "foo" text/turtle                                                       
  5.x : 500                                                                     
POST "foo.ttl", no content-type                                                 
  4.x : "foo.ttl" text/turtle                                                   
  5.x : 500                                                                     
POST "foo", content-type=text/turtle                                            
  4.x : "foo"     text/turtle                                                   
  5.x : "foo.ttl" text/turtle                                                   
POST "foo.ttl", content-type=text/turtle                                        
  4.x : "foo.ttl.ttl" text/turtle                                               
  5.x : "foo.ttl.ttl" text/turtle                                               

Here's the test. I ran it against solid.community for 5.x and against solid.openlinksw.com:8444 for 4.x

const auth       = require('solid-auth-cli')
const text       = "<> a <#test>."

const idp  = "https://jeffz.solid.community"
const base = idp + "/public/nss5-test/"
const file = "test-file"

async function main(){
  let session = await auth.login()
  console.log("Logged in as <"+session.webId+">")
  console.log("Using folder <"+base+">\n")
  await test({
     label       : "POST, no content-type",
     extension   : "",
     contentType : ""
  })
  await test({
     label       : "POST content-type=text/turtle",
     extension   : "",
     contentType : "text/turtle"
  })
  await test({
     label       : "POST, no content-type",
     extension   : ".ttl",
     contentType : ""
  })

}
async function test(opts){
  let url = file + opts.extension
  console.log("    ",opts.label,"<"+url+">")
  let headers = {
    link : '<http://www.w3.org/ns/ldp#Resource>; rel="type"',
    slug : url,
  }
  if(opts.contentType) headers["Content-type"]=opts.contentType
  let res = await auth.fetch( base, {
    method:"POST",
    body:text,
    headers:headers
  })
  if(!res.ok){
    console.log("        ",res.status,res.statusText)
    return
  }
 let location = idp + res.headers.get("location")
 res = await auth.fetch( location )
 location = location.replace(base,'')
 if(res.ok) console.log(
      "        ",
    res.status,
    res.headers.get("content-type"),
    location
  )
  else console.log("        ",res.status,res.statusText)
}
main()

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、提供された Node.js テストをサーバーの POST エンドポイントに対して実行し、各ファイル名とヘッダーの組み合わせについて status、Location、content-type の結果を比較します。5.x の動作が修正されるか、Issue に示されている 4.x の結果に明示的に合わせられれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
api, backend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。