Skip to content

Commit

Permalink
Fixed POST
Browse files Browse the repository at this point in the history
  • Loading branch information
ratavare committed May 28, 2024
1 parent 62916e5 commit e4de991
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 9 deletions.
12 changes: 5 additions & 7 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ server:
host: localhost
port: 8080
server_name: example.com
max_cbsize: 2000m # to do: conversion and mapping
max_cbsize: 2000m
max_conn: 10
redirect: /ola
# * Root definition
root: /
dir_listing: on
root: /pages
index: index.html
http_methods: GET POST
# * Error pages map;
error_pages:
Expand All @@ -32,11 +31,10 @@ server:
index: favicon.ico # default file to open if the request is the dir
dir_listing: off
http_methods: GET POST
route /ola:
root: /srcs/conn
route /up:
root: /pages/uploads
dir_listing: on
http_methods: GET
index: a.cpp Res.cpp Req1.cpp

# * CGI routing;
route /py:
Expand Down
Binary file not shown.
Binary file added pages/uploads/1716908240046_Test cases.docx
Binary file not shown.
Binary file added pages/uploads/1716908240048_test_cases.docx
Binary file not shown.
48 changes: 48 additions & 0 deletions pages/uploads/1716908240051_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Nerd Fonts

This is an archived font from the Nerd Fonts release v3.1.1.

For more information see:
* https://github.com/ryanoasis/nerd-fonts/
* https://github.com/ryanoasis/nerd-fonts/releases/latest/

# JetBrains Mono

JetBrains Mono: a typeface made for developers

For more information have a look at the upstream website: https://github.com/JetBrains/JetBrainsMono

Version: 2.304

## Which font?

### TL;DR

* Pick your font family:
* If you are limited to monospaced fonts (because of your terminal, etc) then pick a font with `Nerd Font Mono` (or `NFM`).
* If you want to have bigger icons (usually around 1.5 normal letters wide) pick a font without `Mono` i.e. `Nerd Font` (or `NF`). Most terminals support this, but ymmv.
* If you work in a proportional context (GUI elements or edit a presentation etc) pick a font with `Nerd Font Propo` (or `NFP`).

### Ligatures

Ligatures are generally preserved in the patched fonts.
Nerd Fonts `v2.0.0` had no ligatures in the `Nerd Font Mono` fonts, this has been dropped with `v2.1.0`.
If you have a ligature-aware terminal and don't want ligatures you can (usually) disable them in the terminal settings.

### Explanation

Once you narrow down your font choice of family (`Droid Sans`, `Inconsolata`, etc) and style (`bold`, `italic`, etc) you have 2 main choices:

#### `Option 1: Download already patched font`

* For a stable version download a font package from the [release page](https://github.com/ryanoasis/nerd-fonts/releases)
* Or download the development version from the folders here

#### `Option 2: Patch your own font`

* Patch your own variations with the various options provided by the font patcher (i.e. not include all symbols for smaller font size)

For more information see: [The FAQ](https://github.com/ryanoasis/nerd-fonts/wiki/FAQ-and-Troubleshooting#which-font)

[SIL-RFN]:http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web_fonts_and_RFNs#14cbfd4a

Binary file added pages/uploads/ola.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions srcs/conn/Res.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,17 @@ int Res::exec_post(void)
if (stream->server->cgi_path.find(FileManager::set_file_ext(name)) != stream->server->cgi_path.end()) {
req->file_path = "./" + name;
req->file_ext = FileManager::set_file_ext(req->file_path);
std::cout << "AAAAAAAAAA" << std::endl;
return (exec_CGI());
}
}
else
throw HttpError("404", "Not Found");
}

if (content_type.find("multipart/form-data;") != 1)
throw HttpError("406", "We can't execute this type of request");

boundary = get_boundary(content_type);
std::cout << "file_path: " << req->file_path << std::endl;
DIR* dir = opendir(req->file_path.c_str());
if (!dir)
throw HttpError("500", "Internal Server Error");
Expand Down

0 comments on commit e4de991

Please sign in to comment.