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

Some changes to fix the path problem under windows system and android TAK client #20

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

kbtxwer
Copy link

@kbtxwer kbtxwer commented Aug 25, 2024

  1. improve the body limit so that it can be able to send large files
  2. directly write the file to it path instead of using a tempfile to avoid the rename operation on windows because it is easy going wrong
  3. modified the "getMetadataGetHandler" function to keep the same performance as the FreeTAKServer
  4. use "ctx.BaseURL() + packageUrl(pi)" instead of "packageUrl(pi)" because my tak client cannot determine which server to connect when the url is not given as full path, even when there is only one server connected. The FreeTAKServer also returns the full path url.

Admin added 4 commits August 26, 2024 00:51
2. directly write the file to it path instead of using a tempfile to avoid the rename operation on windows because it is easy going wrong
3. modified the "getMetadataGetHandler" function to keep the same performance as the FreeTAKServer
4. use "ctx.BaseURL() + packageUrl(pi)" instead of "packageUrl(pi)" because my tak client cannot determine which server to connect when the url is not given as full path, even when there is only one server connected. The FreeTAKServer also returns the full path url.
…ile path which will raise 404 error during access from web

2. EMBED webtak into the program
3. register webTakPathHandler to redirect /webtak to /webtak/ to avoid issues
@kdudkov
Copy link
Owner

kdudkov commented Aug 27, 2024

  1. good point, tnx
  2. if upload fails we can loose file this way
  3. afaik getMetadataGet should return Tool field only, not file
  4. what is your tak client? ATAK/itak work well


addMartiRoutes(app, api.f)
} else {
staticfiles.EmbedWebTak(api.f)
Copy link
Owner

Choose a reason for hiding this comment

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

we don't want to use /webtak handle at all if it's not a webtacRoot

}

func (c *PathUnescapeFs) Open(name string) (http.File, error) {
// 解码路径中的空格
Copy link
Owner

Choose a reason for hiding this comment

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

please use english comments only

@@ -11,9 +12,33 @@ import (
//go:embed static
var staticFiles embed.FS

//go:embed webtak
var webtakFiles embed.FS
Copy link
Owner

Choose a reason for hiding this comment

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

do not embed webtak in the binary

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.

2 participants