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

fix: fix upload URL and preview image on localhost #932

Merged
merged 7 commits into from
Sep 27, 2024

Conversation

AliceLanniste
Copy link
Contributor

@AliceLanniste AliceLanniste commented Sep 20, 2024

close #917

plus:
bug
preview after upload image or file:
image

fix:
image

I think it's a better way to assign process.env.STORAGE_PREFIX should be depend on env variable

@tea-artist tea-artist requested a review from boris-w September 21, 2024 07:52
@tea-artist tea-artist marked this pull request as ready for review September 21, 2024 07:52
@tea-artist tea-artist marked this pull request as draft September 21, 2024 07:54
@AliceLanniste AliceLanniste changed the title fix: fix upload URL fix: fix upload URL and preview image on localhost Sep 22, 2024
@AliceLanniste AliceLanniste marked this pull request as ready for review September 22, 2024 02:29
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 10978018022

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 36 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.04%) to 84.968%

Files with Coverage Reduction New Missed Lines %
apps/nestjs-backend/src/features/calculation/reference.service.ts 2 91.46%
apps/nestjs-backend/src/features/record/record-calculate/record-calculate.service.ts 8 95.87%
apps/nestjs-backend/src/features/field/field-calculate/field-supplement.service.ts 26 95.36%
Totals Coverage Status
Change from base Build 10952476725: 0.04%
Covered Lines: 36893
Relevant Lines: 43420

💛 - Coveralls

@boris-w
Copy link
Contributor

boris-w commented Sep 23, 2024

I don’t understand why 127.0.0.1 needs to be changed to localhost.

@AliceLanniste
Copy link
Contributor Author

AliceLanniste commented Sep 25, 2024

when I start up project on local, it will open browser forward address starts with localhost instead of 127.0.0.1. upload api and preview api starts with 127.0.0.1, it causes #917 and preview error.

fail to preview image
image
image

so I changed 127.0.0.1 to localhost

@boris-w
Copy link
Contributor

boris-w commented Sep 26, 2024

when I start up project on local, it will open browser forward address starts with localhost instead of 127.0.0.1. upload api and preview api starts with 127.0.0.1, it causes #917 and preview error.

fail to preview image image image

so I changed 127.0.0.1 to localhost

It seems that this is a security self-origin configuration restriction of Next.js. I think it’s enough to set STORAGE_PREFIX to localhost

@AliceLanniste
Copy link
Contributor Author

AliceLanniste commented Sep 26, 2024

It seems that this is a security self-origin configuration restriction of Next.js. I think it’s enough to set STORAGE_PREFIX to localhost

OK, I will revert init_app's commit

@boris-w
Copy link
Contributor

boris-w commented Sep 27, 2024

It seems that this is a security self-origin configuration restriction of Next.js. I think it’s enough to set STORAGE_PREFIX to localhost

OK, I will revert init_app's commit

The changes related to file upload are also not necessary. We are using frontend direct upload, and it’s not mandatory to use the upload interface in our openapi.

@boris-w boris-w merged commit e01c973 into teableio:develop Sep 27, 2024
6 of 7 checks passed
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.

Failed to upload image or file
3 participants