-
Notifications
You must be signed in to change notification settings - Fork 71.9k
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
Hopefully fix xdrip uploads #4106
Conversation
Also use full names of content types.
I merged and tested it... It's working! 👍 |
And xdrip stopped complaining about downloading... So it seems it's working fine for me. |
@viq thanks for looking into this. I don't understand your fix at this moment.
so I don't understand why the old code didn't work. What content type is sent by xdrip? |
@jamorham I hope to have a look at this PR later this weekend. |
I think the ordering is more significant here than the change from `json`
to `application/json` etc. --
viq
|
What's the actual bug here? The code change touches content downloading, not uploading, while the ticket title says this is an upload bug |
I'm the first to admit I don't know what I'm doing, since I don't know
JavaScript and I don't know the insides of nightscout nor xdrip. What I can
say is this:
* recent update broke xdrip uploads, with nightscout responding with `405`
to xdrip's POST with JSON inside (verified with `tcpdump`/`tshark`)
* with this change my data from xdrip is again getting into nightscout
* for a while after my change xdrip was showing on it's status panel errors
on downloading from nightscout, but then it started working
* during debugging the issue I tried to restart xdrip (sometimes by
rebooting phone), nightscout and nginx on every change to make sure the
connections are killed and new ones are established, so no old code paths
are reused
--
viq
|
I need to look into this further but I think what's actually wrong is this code:
Where the POST requests also pass the request to the format_entries function, which should AFAIK only be done for requests that load data. |
Can people following this actually test #4114 and tell me if that works. I think I know what's up but need a confirmation |
Just to clarify, your request is to remove my changes, apply yours, and see
if xdrip works with nightscout then? --
viq
|
xDrip just sets the content type to |
@jamorham I tracked down the issue and know what’s causing it but not exactly sure why - looks like something is not exactly right in the Node Express mime type based routing. Anyway, my other PR fixed this |
@viq @jamorham @parapenT1sta PR #4114 of @sulkaharo has been merged to dev and I think that will fix this issue in a better way than this PR. Can on of you confirm that this issue can be closed, because @sulkaharo fixed the xdrip upload? |
@PieterGit I confirm that with a fix from #4114 xdrip uploads work for me, therefore I'm closing this request. |
This fixes uploads from xdrip for me, though I do see following in xdrip: