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

HTTPListener can manage HTTP raw files #64

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cecio
Copy link

@cecio cecio commented Dec 9, 2017

when processing GET/POST the process looks also for a .RAW file

  • if it does not exists, it works as usual
  • if exists, it sends it back
  • For example, with the following, named "success.txt.RAW"
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 8
Last-Modified: Mon, 15 May 2017 18:04:40 GMT
ETag: "ae780585f49b94ce1444eb7d28906123"
Accept-Ranges: bytes
Server: AmazonS3
X-Amz-Cf-Id: DOMFBGDxBc9xK7seJjwbgRcfGUMjatIzbXRAY4nKJan2KJgKx6nM9g==
Cache-Control: no-cache, no-store, must-revalidate
Date: <RAW-DATE>
Connection: close

success

I can emulate the Firefox connection portal.
As you can see I also implemented some "variables" replaced at runtime. In this case ("<RAW-DATE>") is the current time. May be I can add more.

the GET and POST requests, check now for the presence of a file with
extension .RAW. If found, it will be sent without additional headers,
assuming they are in the file itself.
The RAW file can be compiled with simple variables, replaced at runtime:
<RAW-DATE>       current time and date
generate_204.RAW - Used for Android internet check
success.txt - Used by Firefox
@strictlymike
Copy link
Collaborator

strictlymike commented Feb 5, 2018

Hi @cecio, I just wanted to acknowledge your PR. Thanks for contributing! Based on your comments above, it looks like the goal of your PR is to allow the FakeNet-NG operator to supersede specific HTTPListener responses by providing a file that HTTPListener should return when the corresponding resource is requested. Did I understand that correctly?

@cecio
Copy link
Author

cecio commented Feb 5, 2018

Yes, it is exactly this.
Thanks!

@strictlymike
Copy link
Collaborator

Alright, going to prioritize and address evaluating/integrating this in turn with other items. Thanks again!

@cecio
Copy link
Author

cecio commented Feb 5, 2018

Ok, let me know if you need some rework or modification you think could be useful.
Thanks!

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