Server option --redirect-http-from doesn't redirect correctly

未關閉
#1,447 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
30/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
javascript
領域
backend, cli

研究方向

首先找出 redirect-http-from 選項的實作和重新導向伺服器設定。分別使用一個連接埠以及以逗號分隔的多個連接埠重現這些命令;當 Location 標頭使用正確的主機和目標連接埠,且每個已設定的 HTTP 連接埠都個別處理時,即表示完成。

由索引模型根據 Issue 內容生成。

描述

I'm using

/opt/solid $ solid -V
5.3.1

from the nodesolidserver/node-solid-server image on docker hub.

The documentation for solid start says:

--redirect-http-from [value] HTTP port or ','-separated ports to redirect to the solid server port (e.g. "80,8080").

If I start the server like this (using the default listen port for https on 8443)

solid start --redirect-http-from 8000

then I get a log message:

nss_1 | Thu, 16 Jul 2020 13:10:25 GMT solid:settings will redirect from port 8000 to port 8443

However, if I make a request to this port over HTTP, I get this:

$ curl -v http://localhost:8000
* Rebuilt URL to: http://localhost:8000/
*   Trying ::1...
* TCP_NODELAY set
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8000 (#0)
> GET / HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 302 Found
< X-Powered-By: Express
< Location: https://localhost,8000:8443/
< Vary: Accept
< Content-Type: text/plain; charset=utf-8
< Content-Length: 50
< Date: Thu, 16 Jul 2020 13:10:34 GMT
< Connection: keep-alive
<
* Connection #0 to host localhost left intact
Found. Redirecting to https://localhost,8000:8443/

It seems like this has incorrectly read the parameter when creating the redirect server.

Additionally, from the usage text and the code, it seems like you should be able to add multiple http listen ports:

solid start --redirect-http-from 8000,8080,8888

But I get this as an output:

nss_1 | Thu, 16 Jul 2020 13:15:55 GMT solid:settings will redirect from port 8000,8080,8888 to port 8443

In this case I would expect to get this message 3 times, once for each port.

主要語言
JavaScript
星號
1.8k
分支
308
PR 合併指標
30 天內沒有已合併 PR

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

nodeSolidServer/node-solid-server 的其他 Issue

查看 nodeSolidServer/node-solid-server 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。