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

Netfox & Parse: can't see my Parse requests #31

Closed
oferRounds opened this issue Nov 30, 2015 · 9 comments
Closed

Netfox & Parse: can't see my Parse requests #31

oferRounds opened this issue Nov 30, 2015 · 9 comments

Comments

@oferRounds
Copy link

Not sure what could be the reason for that... Any idea?
I see other requests (such ax Mixpanel and Facebook graph) but not Parse ones.

But beside it - great idea and really really great and cool implematation!

Thanks a lot!!

@oferRounds oferRounds changed the title Netfox & Parse: can't see my Parse request Netfox & Parse: can't see my Parse requests Nov 30, 2015
@kasketis
Copy link
Owner

Thanks a lot @oferRounds :)

I'm not a user of Parse SDK so could you please tell me some more thinks? Which methods of Parse SDK do you use? Which version? Do you use the compiled library or you have included the Parse as a subproject in your project (https://github.com/ParsePlatform/Parse-SDK-iOS-OSX)?
Can I have a sample code to reproduce the issue?

Thanks 👍

@kasketis
Copy link
Owner

kasketis commented Dec 1, 2015

@oferRounds
Copy link
Author

@kasketis - Cool, I'll check it later on tonight, and reply here!
Thanks!

@oferRounds
Copy link
Author

I added:

NSURLSessionConfiguration* config = NSURLSessionConfiguration.defaultSessionConfiguration;
config.protocolClasses = @[[NFXProtocol class]];

But it still doesn't work :(

Maybe this link could help?

https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/wiki/Network-Debug-Tool

@oferRounds
Copy link
Author

Ok, my mistake - should have added it to Parse's NSURLSessionConfiguration... So please ignore my previous comment, I'm still checking it.

@oferRounds
Copy link
Author

Waiting to here from Parse:
parse-community/Parse-SDK-iOS-OSX#614

@oferRounds
Copy link
Author

Hi @kasketis

Still with this issue.

I have now been able to add the NFXProtocol to the protocolClasses of Parse's NSURLSessionConfiguration (via swizzling of NSURLSessionConfiguration's defaultSessionConfiguration).

But I'm now facing this scenario:
If the NFXProtocol is being added at index 0 - I get 401 error on all Parse responses. If it's being added to a non-0 index - it doesn't seem to have any affect.
Any idea what might cause that?

This is relevant Parse method, where the NSURLSessionConfiguration is being setup:

+ (NSURLSessionConfiguration *)_urlSessionConfigurationForApplicationId:(NSString *)applicationId
                                                              clientKey:(NSString *)clientKey {
    NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];

    // No cookies, they are bad for you.
    configuration.HTTPCookieAcceptPolicy = NSHTTPCookieAcceptPolicyNever;
    configuration.HTTPShouldSetCookies = NO;

    // Completely disable caching of responses for security reasons.
    configuration.URLCache = [[NSURLCache alloc] initWithMemoryCapacity:[NSURLCache sharedURLCache].memoryCapacity
                                                           diskCapacity:0
                                                               diskPath:nil];

    NSBundle *bundle = [NSBundle mainBundle];
    NSDictionary *headers = [PFCommandURLRequestConstructor defaultURLRequestHeadersForApplicationId:applicationId
                                                                                           clientKey:clientKey
                                                                                              bundle:bundle];
    configuration.HTTPAdditionalHeaders = headers;

    return configuration;
}

I see that the original protocolClasses of Parse are:

"_NSURLHTTPProtocol",
"_NSURLDataProtocol",
"_NSURLFTPProtocol",
"_NSURLFileProtocol",
NSAboutURLProtocol

@Abeansits
Copy link
Contributor

@Janglinator close this?

@Janglinator
Copy link
Contributor

Lol considering Parse is dead, I'd imagine this issue is dead as well. In the future, I hope to stay on top of issues like this before platforms completely shut down XD

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

No branches or pull requests

4 participants