-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
bug: responseUrl json path parsing broken / uploader compat #107
Comments
it appears the regex in with the following hack... diff --git a/ishare/Http/Custom.swift b/ishare/Http/Custom.swift
index 40473e7..d8d5488 100644
--- a/ishare/Http/Custom.swift
+++ b/ishare/Http/Custom.swift
@@ -149 +149 @@ private func tagPlaceholders(in url: String) -> (taggedUrl: String, tags: [(Stri
- let pattern = "\\{\\{([a-zA-Z0-9_]+(\\[[0-9]+\\])?)\\}\\}"
+ let pattern = "\\{\\{(.*)\\}\\}" ...the following iscu works for me: {
"name": "copyparty",
"requestURL": "http://127.0.0.1:3923/screenshots/?j",
"headers": {
"pw": "your_password_here"
},
"fileFormName": "f",
"responseURL": "{{files[0].url}}"
} but I think there might be a second bug as well; when I also include the properties to enable upload deletion, {
"deletionURL": "{{files[0].url}}",
"deleteRequestType": "DELETE"
} ...then I get note that I haven't had a chance to test upload deletion through ishare, but I believe it should work if you run copyparty with the btw, the next version of copyparty (~4 days) will support specifying |
The regex approach has been particularly unclean, I’ve been intending to replace it eventually, hotfix with a pattern change as suggested above will probably resolve this for the time being, as for the parsing error, that I can’t repro, if you’ve had any version prior to v2 installed (which is unlikely) it might be worth trying to wipe the app and all of its data dirs (including icloud data) |
just in case someone configures a value which contains multiple templated values, then perhaps ...but I'll leave the exact fix to you 👍
indeed, i first discovered your project just now (it's really cool btw!) but it appears i am unable to import any iscu which includes either it fails here: if this works for you, then it will be interesting to learn what the difference is between our systems. I am testing this on an m1 mbp running macos 15.2 and xcode 16.1 (16B40). |
also includes a slight tweak to the json upload info: when exactly one file is uploaded, the json-response has a new top-level property, `fileurl` -- this is just a copy of `files[0].url` as a workaround for castdrian/ishare#107 ("only toplevel json properties can be referenced")
Describe the bug
I'm trying to upload files to my https://github.com/9001/copyparty server with ishare. The file uploads to the server perfectly but when ishare copies the responseUrl to my clipboard it doesn't replaced it like it's set to. According to the readme arrays are supported, my server returns a json like
{"files": [{"url:"url"}]}
. I've tried setting responseUrl to{files[0].url}
or{{files[0].url}}
orfiles[0].url
or{{files.url}}
, I'm not sure what I'm doing wrong here.To Reproduce
Steps to reproduce the behavior:
f
and responseUrl to{{files[0].url}}
Expected behavior
It should get the url from the first item of files key in the provided json.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: