sandstorm-io / sandstorm

Sandstorm is a self-hostable web productivity suite. It's implemented as a security-hardened web app package manager.
https://sandstorm.io
Other
6.7k stars 706 forks source link

Encoding error in Proxy.translateResponse #2809

Closed kpreid closed 7 years ago

kpreid commented 7 years ago
TypeError: The header content contains invalid characters
    at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:351:13)
    at ServerResponse.res.setHeader (/programs/server/npm/node_modules/meteor/webapp/node_modules/connect/lib/patch.js:134:22)
    at ServerResponse.writeHead (_http_server.js:180:21)
    at Proxy.translateResponse (server/proxy.js:1810:16)
    at server/proxy.js:1977:21
    at /programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:32:39

Repro:

  1. Create a TinyTinyRSS grain.
  2. Subscribe to https://www.reddit.com/r/amateurradio/comments/5kexic/%CE%BCwwvb_a_tiny_wwvb_station_cat_varloglife/.rss
  3. Select that feed item and press the "o" (open in browser) shortcut.
  4. The above error will show up in the new tab, with a URL of https://<domain>/backend.php?op=article&method=redirect&id=2960, instead of the intended article.

(The comment-thread feed URL is a standiin for the original subreddit feed which of course no longer has that particular entry; both show the same problem.)

I tried other entries from Reddit and other feeds that had non-ASCII characters and could not reproduce the problem. This does suggest that there was something bad about that particular entry, but Sandstorm surely shouldn't be “crashing” here — at least explain what the app did wrong.

dwrensha commented 7 years ago

Thanks for the report! This should be fixed in #2811.