Comments (7)
Ah thats brilliant, thanks!
from connectivity.
The current implementation only checks that the word 'Success' is returned in the response so that would work.
I meant to get around to writing a more robust implementation of this check just in case it ever turns out to be the case that captive portal happens to contain the word as part of the web page served however I'll ensure that I introduce this in a backwards-compatible manner when I do. Hope this helps!
from connectivity.
I've added the option to customise the validity test used when checking connectivity URLs. To only check that the response contains the word Success
you can set the following:
connectivity.expectedResponseString = "Success" // this is the default value
connectivity.validationMode = .containsExpectedResponseString
from connectivity.
Hey @rwbutler, is there any way of being able to set an authorization header token for a connectivity URL? I have an API endpoint thats protected using JWT tokens. Currently have to run a separate unprotected route for checking connectivity status - just wondering if there's an easy way around this, as it would be good to allow only authorised clients to access the endpoint.
from connectivity.
I haven’t got a way of doing this just yet but I’ll look into it and get back to you 👍🏻
Sent with GitHawk
from connectivity.
@vin047 I've just released v2.2.0 which includes a bearerToken
property. If you set your JWT token here it should be supplied to your endpoint. Hope this helps.
from connectivity.
Hey, sorry for the delay in getting back to you. I just had a chance to implement version 2.2.0 and can confirm the bearerToken feature works as expected. Thanks a lot for the effort and for this library! 👍 🥇
from connectivity.
Related Issues (20)
- URLSession must be instantiated once for entire lifespan of Connectivity instance HOT 1
- Disable logging HOT 2
- Importing using SPM: Reachability missing HOT 12
- README/Documentation Appears Out of Date HOT 2
- Adding checks for Ethernet connection HOT 1
- App open and Airplane Mode on from Control Center HOT 5
- How do I monitor the switch from WiFi A to WiFi B? HOT 2
- Xcode / M1: could not find module 'Connectivity' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios-simulator HOT 2
- Wrong connectivity status returned when app is backgrounded HOT 1
- Building Connectivity with Carthage fails HOT 2
- Allow URLRequest & URL HOT 1
- Crashed: com.apple.root.background-qos
- Update podspec on cocoapods HOT 3
- custom `expectedResponse` not working when using Combine publisher mode HOT 6
- Failed connectivity URL HOT 2
- How we can check either the connected connection is poor? HOT 2
- Callback when isConnectedViaWiFiWithoutInternet changes
- Changes in 6.1.0 are breaking but no major version release HOT 1
- Crash in Xcode 15 HOT 7
- Privacy manifest HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from connectivity.