Commit Graph

177 Commits

Author SHA1 Message Date
Vitaliy
ea3347b36d Accept HttpContent as data in WebBrowser (#1828) 2020-06-07 17:09:01 +02:00
JustArchi
cb6c5e2de2 Make it possible for WebBrowser to post custom data
While this isn't required for ASF (at least right now), it'll allow plugins to use ASF's WebBrowser for sending e.g. json to third-party endpoints.
2020-06-06 16:34:20 +02:00
JustArchi
149f2e679f Misc 2020-05-27 14:45:27 +02:00
Kamushek
800d10de96 Fixed NullPropagation (#1809)
* Fixed NullPropagation

* Changes to similar methods
2020-05-27 14:42:12 +02:00
JustArchi
ed0e4498b4 Misc 2020-04-18 19:31:13 +02:00
JustArchi
7b9bec217a Misc 2020-04-18 18:35:37 +02:00
JustArchi
83e6addd94 DON'T LOOK
I warned you.
2020-04-18 18:33:27 +02:00
JustArchi
b23f634c9b Implement IAsyncDisposable for all ASF classes that can make use of it 2020-04-18 17:52:11 +02:00
JustArchi
18de88dda8 Misc 2020-04-18 15:22:59 +02:00
JustArchi
4b7369661c Do not dispose WebBrowser.HtmlDocumentResponse
We're disposing inner document already, and this can't be disposed too early
2020-04-18 14:12:45 +02:00
JustArchi
63c8a6540e Fix some disposable patterns 2020-04-18 14:08:37 +02:00
JustArchi
b5ae8eafba Misc 2020-04-18 13:34:25 +02:00
JustArchi
70d89ad008 Update WebBrowser.cs 2020-04-18 00:35:45 +02:00
JustArchi
fab8c667d2 One more fix 2020-04-18 00:34:10 +02:00
JustArchi
85d4dcbe27 Misc AngleSharp improvements 2020-04-18 00:26:54 +02:00
JustArchi
278935661a Use all new decompression methods for HTTP requests 2020-04-17 23:44:36 +02:00
JustArchi
47b729a14d Correct wrong retrying logic for streams 2020-04-08 13:01:21 +02:00
JustArchi
7a521da68b Update WebBrowser.cs 2020-04-08 12:52:01 +02:00
JustArchi
960dbf9b71 Misc refactor 2020-04-08 12:50:58 +02:00
Vitaliy
5e39731a27 Catch exceptions when creating HtmlDocument from stream (#1725)
* Catch exceptions when creating HtmlDocument from stream

* Use proper retry logic if exception occured

* Add null check for document
2020-04-07 22:12:01 +02:00
JustArchi
1e87341877 Small cleanup 2020-04-02 17:16:05 +02:00
Vitaliy
fbe5bd12ae Use streams for http responses instead of strings where possible, replace HtmlAgilityPack with AngleSharp (#1703)
* Replace HAP with AngleSharp, add stream support to WebBrowser

* Fix skipped nullable operator

* Add extension method

* Rename function to be closer to HAP API

* Add JSON deserialization from stream, fix variable names, remove obsolete code

* Add more extension methods

* Fixes after review:

Remove excessive dependency
Move string value to const
Different handling for null and empty cases for confirmations
Use more human-friendly names

* Add http completion options, make GetToStream private

* Cleanup

* Add null checks, make StreamResponse disposable

* Refactor UrlGetToBinaryWithProgress into using UrlGetToStream
2020-04-02 17:01:55 +02:00
JustArchi
ff3ecad6d1 Add workaround for POST limit size 2020-02-24 21:11:54 +01:00
JustArchi
dbf740f560 Use more robust approach 2020-02-21 17:10:42 +01:00
JustArchi
a60c3d6376 Use HTTP/2 explicitly on .NET Core 2020-02-21 17:07:05 +01:00
Vitaliy
9a47f53398 Use HttpVersion.Version20 instead of creating Version instance (#1650) 2020-02-21 16:33:21 +01:00
JustArchi
0370168b02 Happy new year 2020-02-01 23:33:35 +01:00
JustArchi
067293eeb5 Start with .NET Core 3.0 code enhancements 2019-09-27 20:43:11 +02:00
JustArchi
fc23a426a2 Misc 2019-07-05 11:43:20 +02:00
JustArchi
d70e71dd68 Closes #1312 2019-07-05 11:39:19 +02:00
JustArchi
4faabe2429 Omit RFC for Steam compat 2019-06-19 16:42:04 +02:00
JustArchi
24732a6f61 Misc 2019-06-19 14:14:35 +02:00
JustArchi
0199654628 Decrease number of MaxConnections to 5
It's generally expected to have up to 5 open connections from a consumer to particular website.
2019-05-19 23:03:40 +02:00
JustArchi
b98268a465 R# cleanup, small code improvements 2019-05-19 15:38:06 +02:00
JustArchi
ab92065185 Misc 2019-04-10 19:24:42 +02:00
JustArchi
977b82ee2e Misc 2019-04-10 18:35:21 +02:00
JustArchi
d8afe989aa Misc 2019-04-05 16:44:31 +02:00
JustArchi
91e495605b Port ArchiBot's WebBrowser client errors handling
First important change is for all requests sent by ASF. Across those 4 years of development I do not remember a single situation where retrying on 4xx status code brought any improvement, bad request has to be handled by us, access denied and not found won't disappear after retry, all other ones are rather unused. Therefore, it makes sense to skip remaining tries on 4xx errors and do not flood the service with requests that are very unlikely to change anything.
Second change is smaller one and it allows the consumer of WebBrowser to declare that he's interested in handling client error codes himself. This way he can add extra logic and appropriately react to them - ASF uses it in statistics module, where the listing can signal refusal to list due to e.g. outdated ASF version through 403. Previously this was treated on the same level as timeout, which wasn't optimal.
2019-04-05 16:24:02 +02:00
JustArchi
b677ba8202 Code/style cleanup 2019-02-16 17:34:17 +01:00
JustArchi
46d61196c7 Share HttpClient with SK2 WebAPI 2019-02-11 03:52:14 +01:00
JustArchi
d5259c230e Open more PublicAPI interfaces 2019-01-17 16:37:16 +01:00
JustArchi
18d5f1938f Open configs for public API 2019-01-14 21:50:23 +01:00
JustArchi
e1e9a9f457 Rider cleanup 2019-01-14 19:11:17 +01:00
JustArchi
192656cd02 Implement basic code contracts 2019-01-10 23:44:32 +01:00
Łukasz Domeradzki
0f2a816b92 Implement plugin system (#1020)
* Implement basic plugin system

* The dawn of new era

* Add plugins warning

* Move more members to PublicAPI

* Open commands for the plugins

* Add IBotHackNewChat

* Run plugin events in parallel

* Use properties in IPlugin

* Hook our custom plugin into CI to ensure it compiles

* Fix dotnet brain damage

* Add IBotsComparer

* Add code documentation

* Add IBotTradeOffer

* Add IBotTradeOffer example

* Add IBotTradeOfferResults

* Final bulletproofing

* Final renaming
2019-01-10 22:33:07 +01:00
JustArchi
76d37179c8 Misc 2019-01-07 19:01:09 +01:00
JustArchi
cf63065681 Implement redirection RFC in WebBrowser 2019-01-06 19:20:24 +01:00
JustArchi
5f33512658 Closes #991 2019-01-02 18:09:07 +01:00
JustArchi
3bbddcf723 Happy new year 🎉 2019-01-02 16:32:53 +01:00
JustArchi
f8aa8babcf R# cleanup 2018-12-15 00:27:15 +01:00