Skip to content
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

Attach correct Content-Type to HTTP header #4555

Merged
merged 6 commits into from
Apr 1, 2020

Conversation

KSXGitHub
Copy link
Contributor

@KSXGitHub KSXGitHub commented Apr 1, 2020

Fix #4553.

Test

I did not add any test. My attempt to use deno test to run file_server_test.ts has not been successful.

@CLAassistant
Copy link

CLAassistant commented Apr 1, 2020

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - no need to add a test.

tmp.ts Outdated Show resolved Hide resolved
@KSXGitHub
Copy link
Contributor Author

@ry

Thanks - no need to add a test.

Does this mean that someone else will add it for me? Tests are useful against unwanted regression.

@ry
Copy link
Member

ry commented Apr 1, 2020

cargo test std_test to run the tests.

I suppose a test is useful. I was thinking that this is just an example program so it doesn't matter that much, but it should indeed have a test.

@KSXGitHub
Copy link
Contributor Author

@ry I am trying to compile Deno (so far, without success).

@KSXGitHub
Copy link
Contributor Author

@ry The time it takes to clone all git submodules is too long. I guess you could just merge this then?

@ry
Copy link
Member

ry commented Apr 1, 2020

@KSXGitHub I added a test - please take a look.

std/http/file_server.ts Outdated Show resolved Hide resolved
@KSXGitHub
Copy link
Contributor Author

@ry I tried using deno to run the script directly:

  (zsh)   deno run --allow-all --reload=https://raw.githubusercontent.com/KSXGitHub/deno/file-server-content-type/std/http/file_server.ts https://raw.githubusercontent.com/KSXGitHub/deno/file-server-content-type/std/http/file_server.ts
Download https://raw.githubusercontent.com/KSXGitHub/deno/file-server-content-type/std/http/file_server.ts
Compile https://raw.githubusercontent.com/KSXGitHub/deno/file-server-content-type/std/http/file_server.ts
error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.

► https://raw.githubusercontent.com/KSXGitHub/deno/file-server-content-type/std/http/file_server.ts:301:18

301 function main(): Promise<void> {
                     ~~~~~~~~~~~~~

screenshot

@KSXGitHub
Copy link
Contributor Author

@ry It works great! 👍

@KSXGitHub KSXGitHub requested a review from ry April 1, 2020 16:50
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks @KSXGitHub !

@ry ry merged commit fa7929a into denoland:master Apr 1, 2020
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 21, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/std/http/file_server.ts should set correct Content-Type
4 participants