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

Adding the InsecureSkipVerify option to a request and new FinalUrl field in the response model. #279

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

lif0
Copy link
Contributor

@lif0 lif0 commented Nov 14, 2023

Purpose of Changes

This PR adds the InsecureSkipVerify option to a request and new FinalUrl field in the response model.

InsecureSkipVerify in the option - allows you to dynamically set this flag, as opposed to the static setting in the current implementation.

FinalUrl in the response model - This field is useful when redirection is active. For instance, if we make a request to https://rb.gy/3hwz5h, we will be redirected to the resource https://www.google.com. The FinalUrl field will then contain the final resource, i.e., https://www.google.com.

Implementation

I added the InsecureSkipVerify option. This allows users to bypass SSL certificate verification when making HTTP requests.

I also added the FinalUrl field to the Response structure. This allows users to see the final URL to which a request was redirected.

Testing

I tested the changes by running several test requests and confirmed that FinalUrl and InsecureSkipVerify function correctly.

add in response url;
add test;
@lif0
Copy link
Contributor Author

lif0 commented Nov 14, 2023

@Danny-Dasilva Hello, could you check & merge this if all is correct

@Danny-Dasilva
Copy link
Owner

This looks good, I'll likely add some changes so that FinalUrl is parsed on the JS side. I appreciate the work, I'll get this merged in later today.

@lif0
Copy link
Contributor Author

lif0 commented Nov 15, 2023

I would have done this myself, but I see that the folder ./dist is listed in .gitignore.

@Danny-Dasilva
Copy link
Owner

Danny-Dasilva commented Nov 15, 2023

I would have done this myself, but I see that the folder ./dist is listed in .gitignore.

the dist folder gets compiled down, you would have to add it somewhere here

CycleTLS/src/index.ts

Lines 48 to 56 in 0a1c895

export interface CycleTLSResponse {
status: number;
body: string | {
[key: string]: any;
};
headers: {
[key: string]: any;
};
}
No worries though I can get that done

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