Archived
1
0
Commit Graph

2030 Commits

Author SHA1 Message Date
d7f67b80df chore: add CODE_OF_CONDUCT to fmt script 2021-02-03 09:52:59 -07:00
a1a0aec472 Create CODE_OF_CONDUCT.md 2021-02-03 09:51:39 -07:00
4756257207 refactor: rename doc to docs 2021-02-03 09:46:35 -07:00
4c6ad046b0 Merge pull request #2643 from cdr/add-playwright
feat(testing): add playwright
2021-02-02 11:02:06 -07:00
6685a3e364 feat: update workflow 2021-02-01 15:11:45 -07:00
66fe663e33 feat: add playwright 2021-02-01 15:11:28 -07:00
966e9cc238 Merge pull request #2609 from cdr/proxy-res-d629
Fix body proxying, redirect proxying and add tests
2021-02-01 11:39:44 -05:00
a60f61f9b3 proxy.test.ts: Add POST body test and redirection tests
Closes #2377
2021-02-01 11:16:52 -05:00
58d72d53a1 routes/index.ts: register proxy routes before body-parser
Any json or urlencoded request bodies were being consumed by body-parser
before they could be proxied. That's why requests without Content-Type
were proxied correctly as body-parser would not consume their body.

This allows the http-proxy package to passthrough the request body correctly
in all instances.

Closes #2377
2021-02-01 11:08:40 -05:00
f5cf3fd331 proxy.ts: Do not always rewrite redirects against the base path
This breaks --proxy-path-passthrough

However, we still need this when that code is disabled as many apps will
issue absolute redirects and expect the proxy to rewrite as appropriate.

e.g. Go's http.Redirect will rewrite relative redirects as absolute!
See https://golang.org/pkg/net/http/#Redirect
2021-02-01 11:08:40 -05:00
d7f06975a6 test: Switch from leaked-handles to wtfnode (#2604)
See my comments at
https://github.com/cdr/code-server/pull/2563#issuecomment-763394741
2021-02-01 11:06:49 -05:00
5446e0ad43 doc/FAQ.md: Link to VSCodium's extension marketplace docs as well (#2603) 2021-02-01 09:52:16 +00:00
22ebfdc3af doc/guide.md: Update caddy install instructions (#2601)
Caddy has new installation instructions for Debian.

Closes #2599
2021-02-01 09:51:48 +00:00
aab973a795 Merge pull request #2640 from cdr/issue-1343-control-c
doc/ipad.md: add ctrl c workaround
2021-01-28 16:33:03 -07:00
a4a0048b90 Merge pull request #2639 from cdr/ipad-docs-install-pwa
doc/ipad.md: add install pwa
2021-01-28 16:32:46 -07:00
1fcb0c3ddd Merge pull request #2641 from cdr/send-ready-to-all-origins
Send 'loaded' event to all parent origins
2021-01-27 05:52:13 +10:00
42dcfc94ab Send 'loaded' event to all parent origins 2021-01-27 05:06:04 +10:00
db359c40c7 docs: add install pwa to ipad 2021-01-26 11:18:41 -07:00
8f0066b4a8 docs: add ctrl c workaround for ipad 2021-01-26 10:44:27 -07:00
fa548e95e1 Merge pull request #2564 from cdr/issue-2550-migrate-mocha-jest
refactor(tests): migrate from mocha to jest
2021-01-25 17:12:39 -07:00
102f51ce1f fix: surpress console log in cli test 2021-01-25 16:34:43 -07:00
14c5aecd45 chore: update ts config and jest config 2021-01-25 16:34:32 -07:00
3044224729 feat: add support for code coverage shield 2021-01-25 16:21:07 -07:00
05beccf671 refactor: move jest around and add code coverage 2021-01-22 14:18:45 -07:00
883dd13850 refactor: move jest and add package.json to /test 2021-01-21 14:06:49 -07:00
646ee3ad7f refactor: correct type signature in app.ts 2021-01-21 10:11:56 -07:00
850c7e1a91 fix: add void for resolve in socket test 2021-01-21 10:11:10 -07:00
6bf51caa17 fix(app.ts): resolve with server 2021-01-21 10:11:10 -07:00
f13ba9401b fix(TS error): add void to promise in util 2021-01-21 10:11:10 -07:00
75717749b2 refactor: upgrade TS to 4.1.3 2021-01-21 10:11:09 -07:00
0a07d67c8d fix: prevent mocha/jest types conlict
Modify the tsconfig.json in lib/vscode/src/build.

This adds the flag skipLibCheck: true to tell TypeScript
to not type-check the declaration files at build time.

We need to add this because otherwise it checks the declaration
files and reports an error of duplicate type definitions
because we use Jest for our tests and they use Mocha and they
both use the global namespace "test" in their .d.ts files.
2021-01-21 10:11:09 -07:00
bea8bb0519 refactor: remove mocha 2021-01-21 10:10:33 -07:00
de7d0394ae refactor: tests from mocha to jest 2021-01-21 10:10:32 -07:00
cef7d42652 feat: setup jest 2021-01-21 10:10:32 -07:00
c52198f30d install.sh: Fix usage of su (#2529)
See also https://github.com/cdr/code-server/pull/2529#issuecomment-763829674
2021-01-20 13:03:13 -05:00
28e98c0ee0 Merge pull request #2563 from cdr/proxy-path-passthrough-0bb9
pathProxy.ts: Implement --proxy-path-passthrough
2021-01-20 02:44:29 -05:00
c32d8b155f heart.ts: Fix leak when server closes
This had me very confused for quite a while until I did a binary search
inspection on route/index.ts. Only with the heart.beat line commented
out did my tests pass without leaking.

They weren't leaking fds but just this heartbeat timer and node of
course prints just fds that are active when it detects some sort of leak
I guess and that made the whole thing very confusing. These fds are not
leaked and will close when node's event loop detects there are no more
callbacks to run.

no of handles 3

tcp stream {
  fd: 20,
  readable: false,
  writable: true,
  address: {},
  serverAddr: null
}

tcp stream {
  fd: 22,
  readable: false,
  writable: true,
  address: {},
  serverAddr: null
}

tcp stream {
  fd: 23,
  readable: true,
  writable: false,
  address: {},
  serverAddr: null
}

It kept printing the above text again and again for 60s and then the
test binary times out I think. I'm not sure if it was node printing the
stuff above or if it was a mocha thing. But it was really confusing...

cc @code-asher for thoughts on what was going on.

edit: It was the leaked-handles import in socket.test.ts!!!
Not sure if we should keep it, this was really confusing and misleading.
2021-01-20 02:06:44 -05:00
5c06646f58 Formatting and linting fixes 2021-01-20 02:06:44 -05:00
60233d0974 test/proxy.test.ts: Implement 2021-01-20 02:06:44 -05:00
240c8e266e test: Implement integration.ts for near full stack integration testing 2021-01-20 02:06:44 -05:00
64e915de4a test: Rename testutil.ts to httpserver.ts 2021-01-20 02:06:44 -05:00
d3074278ca app.ts: Fix createApp to log all http server errors
cc @code-asher
2021-01-20 02:06:43 -05:00
8acb2aec11 plugin.test.ts: Switch to testutil.HttpServer 2021-01-20 02:06:43 -05:00
ea1949e440 test: Add testutil.HttpServer
The goal is to remove supertest as it does not support typescript well
and there's really no good reason for the dependency. Also no websocket
testing support.
2021-01-20 02:06:43 -05:00
9efcf7f3ce FAQ.md: Document wds problem with create-react-app and pathProxy.ts 2021-01-20 02:06:43 -05:00
ba4a24809c routes/index.ts: Correctly register wsErrorHandler
express requires all 4 arguments to be declared for a error handler.
It's very unfortunate that our types do not handle this.
2021-01-20 02:06:43 -05:00
497b01bffe FAQ.md: Document --proxy-path-passthrough
And the concerns surrounding it.

Closes #2485
2021-01-20 02:06:43 -05:00
f169e3ac66 pathProxy.ts: Implement --proxy-path-passthrough
Closes #2222
2021-01-20 02:06:43 -05:00
c17f3ffc79 Merge pull request #2596 from cdr/rdbeach
vscode.ts: Fix close current folder
2021-01-20 01:59:12 -05:00
d234ddc1e1 vscode.ts: Fix close current folder
Fixes VscodeProvider to correctly obey the ew parameter.

Based on changes by @rdbeach. See the previous commit.
2021-01-18 11:29:18 -05:00