Skip to content

Mis-interpretation of what is being transmitted by a remote httpclient request... #129

Closed
@Albacheeser

Description

@Albacheeser

I have found a bug in the API.CFG. It is in the section of the code in line 520s area where it is determining which mime type is being used (presumably to determine the function to call).

Background:
I am using Appcelerator Titanium 3.0 to build mobile apps because it is great for having one codebase for my mobile app but can port to 1) Android 2) iOS or 3) MobileWeb.

Here is the symptom of the problem:

  • URL submitted from Mock Client or any browser (PC or mobile) - WORKED FINE 200!!
  • URL submitted from a mobile app written in Titanium 3.0 (javascript based dev platform). It has an HTTPClient class that is used. I won't bore you with code. - 400 BAD REQUEST

Well, obviously the Titanium HTTPClient calls to Taffy are not supplying exactly the same info that occurs when a user submits the very SAME URL into a browser.

I explored for 3 days all the different special idiosyncrasies of any platform involved including the server, the server software, Titanium, etc.

Then, I decided to GREP all of the places in the CORE that had 400 just to see if Taffy was initiating the problem. I found about 7 or 8 places. So I iteratively went through and changed each one to 403 to see if the remote call from the mobile device would get a 403 instead of a 400. Low and behold it did and here is the place in the code where it occurs:

FILE: API.CFG
troubhleshooting

CONCLUSION:
the API.CFG claims that the "Your default mime type (#application._taffy.settings.defaultMime#) is not implemented". But would not that same fact be true whether regardless from where I submitted the URL? I believe there is a mismatch perhaps in the logic between the mimeType and mimeEXT.

Of course, I did not dig any deeper to determine what is different about what is being delivered to Taffy from a browser versus the mobile app httpclient. However, I suspect you all might be able to figure it out and let me know.

WHAT I DID AS A WORKAROUND FOR NOW:
I remarked out the code that claims the defaultMime is not implemented and just forced it to return "json" because that was the value of #application._taffy.settings.defaultMime#.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions